Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fcntl() when filesystem does not support flock(). #3311

Open
mnijhuis-tos opened this issue Jul 31, 2023 · 0 comments
Open

Use fcntl() when filesystem does not support flock(). #3311

mnijhuis-tos opened this issue Jul 31, 2023 · 0 comments
Assignees
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

Comments

@mnijhuis-tos
Copy link

mnijhuis-tos commented Jul 31, 2023

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.

@derobins derobins added Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - C Library Core C library issues (usually in the src directory) Type - Bug / Bugfix Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub labels Aug 3, 2023
@derobins derobins added this to the 1.14.4 milestone Oct 17, 2023
@derobins derobins modified the milestones: 1.14.4, 1.14.5 Jan 19, 2024
@derobins derobins modified the milestones: 1.14.5, 2.0.0 Oct 15, 2024
@fortnern fortnern self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants