Repository navigation
pnfs-common: re-arm a client's layout hold after a fence, and count its data through the MDS (SFAM-2850) - #33
Merged
Conversation
…device 0001 primed a client on a filesystem when its probe was granted a layout, and nothing unprimed it. In SFAM-2850 a metadata server failover fenced a client's key, the client marked the device unavailable, and its probe was granted a layout it could not use, which primed it. Two minutes later an application task made the device lookup, which fails in a pod's mount namespace, and the mount sent all of its I/O through the server every two minutes from then on. Kernel patch 0026 unprimes the client and restarts its hold when it writes the probe through the server outside grace, and when nfsd fences it on the filesystem's device. No earlier patch did this: 0001 is unchanged from d64d549 to 8bce4bd, 07a25e6 only made the hold per generation, and no other patch on any branch touches it. The series 0001 to 0026 applies to a clean 6.18.55, and fs/nfsd and fs/xfs build without warnings at W=1 (arm64), fs/nfsd also with pNFS disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rver Kernel patch 0027 has nfsd count, per client, the bytes of the READs and WRITEs it carries on an export that hands out layouts. Grace, the client's layout hold, and loopback clients are excluded, because data through the server is expected there. /proc/fs/nfsd/clients/<id>/info shows the counts as "pnfs mds read bytes" and "pnfs mds write bytes". In SFAM-2850 a client sent 6.8 GB through the server in 11 minutes and nothing said which client. The guest agent (simplyblock-operator, fix/pnfs-probe-on-mds-data) logs each client whose count grows. The series 0001 to 0027 applies to a clean 6.18.55, and fs/nfsd and fs/xfs build without warnings at W=1 (arm64), fs/nfsd also with pNFS disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
A critical race allows an in-flight LAYOUTGET to bypass the restarted hold because re-arming leaves the generation unchanged, potentially recreating SFAM-2850.
1 open issue
What changed in this PR
This PR extends the shared pNFS kernel patch series to help clients resume direct device I/O after fencing or failover, addressing SFAM-2850, and adds visibility into traffic handled by the metadata server.
Changes:
- Re-arm client layout holds after fencing or probe writes through the metadata server outside grace.
- Add per-client metadata-server read/write byte counters, excluding loopback clients, grace periods, and active holds.
- Document both patches and update the patch count.
| File | Description |
|---|---|
prototype/boards/pnfs-common/README.md |
Documents recovery behavior and per-client counters. |
prototype/boards/pnfs-common/patches/linux/0027-nfsd-count-the-data-each-client-sends-through-a-pNFS-server.patch |
Adds metadata-server traffic counters to client information. |
prototype/boards/pnfs-common/patches/linux/0026-nfsd-hold-a-client-s-layouts-again-when-its-probe-misses-the-device.patch |
Restarts layout holds after fencing or probe fallback. |
Review effort: Balanced
LAYOUTGET checked the layout hold a second time, after mapping the blocks, only when a grow had raised the generation. An unprime from 0026 (a fence, or the probe written through the server) leaves the generation as it was, so a request that passed the first check while the client was still primed handed out a layout the restarted hold should have refused. Check again for every request except the probe. 0027 is regenerated on top; its changes are the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Fixes the server side of SFAM-2850: after an MDS failover, a pNFS client stayed on the metadata server for the rest of the run.
Root cause
Patch 0001 holds a client's layouts until the CSI probe, which runs in the host mount namespace, is granted one. After the grant the client stays primed, and nothing ever unprimes it. In the failing run (
pnfs_rwx_rapid_nogap_k8s-20261106-223856, worker-3):/devhas nodisk/by-id, and failed. The probe failed 482 times over 16 minutes.This is not a reverted behavior. 0001 is unchanged from d64d549 to 8bce4bd, 07a25e6 only made it per-generation, and no other patch touches the hold.
Changes
0026: unprime the client and restart the hold:
nfsd4_cb_layout_done's fence branch, and the 0019 unreturned-layout fence)With the hold re-armed, the next LAYOUTGET waits for the probe from the host namespace again.
0027: per-client
pnfs mds read bytes/pnfs mds write bytesin/proc/fs/nfsd/clients/*/info, so the server can name a client whose data goes through it. Bytes are not counted for loopback clients, during grace, or while a hold is active.README: the patch count and the two new paragraphs.
Verification
CONFIG_NFSD_PNFS.pnfsos-b6a7871was built (run 44308992481) and tested on dev-ocp (CentOS Stream CoreOS 10, kernel 6.12 clients):Companion operator PR: simplyblock/simplyblock-operator#931
🤖 Generated with Claude Code