Use fcntl() when filesystem does not support flock(). #3311
Labels
Component - C Library
Core C library issues (usually in the src directory)
Priority - 2. Medium ⏹
It would be nice to have this in the next release
Type - Bug / Bugfix
Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Milestone
When opening a file read-only on a "dvs" filesystem, HDF5 will complain that it cannot lock the file and it reports (among others):
#6: H5Fint.c line 1898 in H5F_open(): unable to lock the file
#7: H5FD.c line 1625 in H5FD_lock(): driver lock request failed
#8: H5FDsec2.c line 1002 in H5FD__sec2_lock(): unable to lock file, errno = 524, error message = 'Unknown error 524'
I found that error 524 corresponds to ENOTSUPP (Not supported). According to https://manualzz.com/doc/12737309/dvs-administration-guide#p39, using flock() on a "dvs" filesystem indeed is not supported and returns this error.
The dvs manual reports that locking using fcntl() is supported, so it would be nice if HDF5 would try using fcntl() when flock() returns ENOTSUPP.
As a workaround, I will disable locking using the HDF5_USE_FILE_LOCKING=FALSE environment variable for now. In my case, I only open the files in read-only mode so locks are not needed.
The text was updated successfully, but these errors were encountered: