Skip to content

Add LocalPathName::device() used by FDB-738 nfs support - #385

Open
mcakircali wants to merge 8 commits into
developfrom
feature/FDB-738-nfs-support
Open

mcakircali wants to merge 8 commits into
developfrom
feature/FDB-738-nfs-support

Conversation

@mcakircali

@mcakircali mcakircali commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Added LocalPathName::device for FDB-738 nfs support

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/eckit/pull-requests/PR-385

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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() returning major: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.

Comment thread src/eckit/filesystem/NFSMountInfo.cc Resolved
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the device-identification and mount-option helpers supporting NFS handling.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants