Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-49684

Linux QSettings lock file on NFS unavailable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.5.0
    • Core: I/O
    • None
    • Linux
    • b2c7c489ab40efb1f2f64aba5b90f5f4fb8d8536

    Description

      Our application is using QSettings for preferences which are saved in ~/.config no problems with Qt 5.1.1, but Qt 5.5.0 in the same situation gives the warning,
      setNativeLocks failed: Resource temporarily unavailable
      Which comes from src/corelib/io/qlockfile_unix.cpp because on NFS (where the home directories are mounted), setNativeLocks calls flock (which on NFS turns into a POSIX lock), then calls fcntl which tries to take a POSIX lock, but can't because we already have one. qlockfile_unix.cpp will check if that locking order will succeed, but it will use a temporary file in /tmp which is a local filesystem.

      I have coded a change to check if the lock file is on NFS and avoid the second fcntl if it is. Unfortunately I don't see a platform independent header file to get the NFS_SUPER_MAGIC value, so this solution will be Linux only.

      Attachments

        1. main.cpp
          2 kB
        2. setting.pro
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            david@fries.net David Fries
            david@fries.net David Fries
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes