]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFSD: Track svc_export in nfs4_stid
authorChuck Lever <chuck.lever@oracle.com>
Sun, 19 Apr 2026 18:53:05 +0000 (14:53 -0400)
committerChuck Lever <cel@kernel.org>
Tue, 9 Jun 2026 20:32:59 +0000 (16:32 -0400)
commitba0cde5dc81d214684b8ea0bd87414ba2f48fe02
tree1e2bb9ecd2b6f3e275f320273928e82d1a443b46
parent8fc274883530a9f2c9f69d96e0255df584b5ff61
NFSD: Track svc_export in nfs4_stid

Add an sc_export field to struct nfs4_stid so that each stateid
records the export under which it was acquired.  The export
reference is taken via exp_get() at stateid creation and released
via exp_put() in nfs4_put_stid().

Open stateids record the export from current_fh->fh_export.
Lock stateids and delegations inherit the export from their
parent open stateid. Layout stateids inherit from their
parent stateid. Directory delegations record the export from
cstate->current_fh.

A subsequent commit uses sc_export to scope state revocation to a
specific export, avoiding the need to walk inode dentry aliases at
revocation time.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4layouts.c
fs/nfsd/nfs4state.c
fs/nfsd/state.h