Skip to content

Confine the inter-server copy interface to fs/nfs_common

Chuck Lever linux-nfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4nfs_common: Remove unused nfs_ssc_client_ops infrastructurefs/nfs/super.c fs/nfs_common/nfs_ssc.c fs/nfsd/nfs4proc.c +1 more+0 -890 replies
2/4NFSD: Hoist nfs42_ssc_open() into fs/nfs_common/nfs_ssc.cfs/nfs_common/nfs_ssc.c fs/nfsd/nfs4proc.c include/linux/nfs_ssc.h+66 -300 replies
3/4nfs_common: Synchronize access to the SSC client ops tablefs/nfs/nfs4file.c fs/nfs_common/nfs_ssc.c include/linux/nfs_ssc.h+32 -100 replies
4/4NFSD: Split linux/nfs_ssc.hfs/nfs_common/nfs_ssc.c fs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c +3 more+66 -370 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Confine the inter-server copy interface to fs/nfs_common

Inter-server copy has drawn a steady trail of use-after-free and reference-leak fixes: 75333d48f922, 34e8f9ec4c9a, and d2c343c51caf among them. They cluster on one object, the source mount that the NFS client creates and opens while NFSD decides when it may be torn down. The bookkeeping that tracks it, added by f4e44b393389, has needed three follow-on repairs of its own. Splitting an object's lifetime across two modules that are forbidden to call each other directly is what keeps producing these bugs.

The fix in 75333d48f922 narrowed that split rather than adding another rule to it. NFSD stopped reaching back through the broker to deactivate the source superblock, and post-copy clean-up became the laundromat's business alone. What the fix did not do was retract the interface it had just stopped using, so the client-side registration machinery has sat unused since (patch 1).

One implicit contract between the two modules is still in force. Reading the client ops table without synchronization is safe only for reasons that live on the caller's side: an inter-server copy holds an active vers=4.2 mount of the source, that mount pins the nfsv4 module, and unregister runs only at module exit. Patch 3 replaces that with synchronization the broker owns, so the argument no longer depends on how a caller in another subsystem manages mounts.

What remains after that is textual. The header still declares both sides' interfaces, so each implementation parses the other's types and inherits its includes, which is how <uapi/linux/nfs.h> reaches nfs4proc.c. Once the knowledge only NFSD holds has moved into the broker, splitting that header is mechanical.

None of this fixes a live bug, and the source mount's lifetime still spans both modules. What changes is that the broker no longer relies on rules its callers enforce. Inter-server copy behavior is meant to be unchanged throughout.

Chuck Lever (4):
nfs_common: Remove unused nfs_ssc_client_ops infrastructure
NFSD: Hoist nfs42_ssc_open() into fs/nfs_common/nfs_ssc.c
nfs_common: Synchronize access to the SSC client ops table
NFSD: Split linux/nfs_ssc.h

 fs/nfs/nfs4file.c        |   1 +
 fs/nfs/super.c           |  25 --------
 fs/nfs_common/nfs_ssc.c  | 126 ++++++++++++++++++++++++---------------
 fs/nfsd/nfs4proc.c       |  22 ++-----
 fs/nfsd/nfs4state.c      |   2 +-
 fs/nfsd/xdr4.h           |  13 ++++
 include/linux/nfs_ssc.h  |  69 ++++-----------------
 include/linux/nfsd_ssc.h |  38 ++++++++++++
 8 files changed, 147 insertions(+), 149 deletions(-)
 create mode 100644 include/linux/nfsd_ssc.h
Signature · 1 line
2.54.0