Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.5.0
-
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.