Repository navigation
Add LocalPathName::device() used by FDB-738 nfs support - #385
Open
mcakircali wants to merge 8 commits into
Open
mcakircali wants to merge 8 commits into
mcakircali wants to merge 8 commits into
Conversation
With `nolock` or `local_lock=posix|all` the kernel grants fcntl locks,
including OFD locks, without asking the NFS server, so they do not
exclude processes on other clients. NFSv4 mounts cannot be in that
state: the kernel clears these flags for them.
Add eckit::filesystem::nfs::local_lock_option, which finds the offending
option for a device ("major:minor") in a mount table in
/proc/self/mountinfo format. The overload without a stream reads the
mount table of the process; it reports nothing off Linux.
Return the device of the filesystem holding a path as "major:minor", the form of the third column of /proc/self/mountinfo. It is the same for every path on a filesystem, so it identifies a filesystem when looking up mount options or caching a per-filesystem result.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The parser can incorrectly report client-local locking when an explicit local_lock setting overrides nolock.
1 open finding
What changed in this PR
Adds filesystem device identification and NFS lock-option inspection to support FDB-738.
Changes:
- Adds
LocalPathName::device()returningmajor:minor. - Adds a parser for NFS client-local locking options.
- Registers the new sources and adds filesystem tests.
| File | Description |
|---|---|
| tests/filesystem/test_nfsmountinfo.cc | Tests NFS mount-option parsing. |
| tests/filesystem/test_localpathname.cc | Tests device identification and mount-table access. |
| tests/filesystem/CMakeLists.txt | Registers parser tests. |
| src/eckit/filesystem/NFSMountInfo.h | Declares NFS locking inspection APIs. |
| src/eckit/filesystem/NFSMountInfo.cc | Implements mount-table parsing. |
| src/eckit/filesystem/LocalPathName.h | Declares device(). |
| src/eckit/filesystem/LocalPathName.cc | Implements device identification. |
| src/eckit/CMakeLists.txt | Registers new library sources. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The kernel lets nolock override any local_lock= value (nfs_try_mount_request) and prints local_lock=all for it, so a mount that lists nolock has client-local fcntl locks whatever else it lists. Add cases for nolock next to local_lock=none and local_lock=flock, in both orders, and say so in the parser and the header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Added LocalPathName::device for FDB-738 nfs support
Contributor Declaration
By opening this pull request, I affirm the following:
🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/eckit/pull-requests/PR-385