Skip to content

RFC nfsd: close potential race between open and setting delegation

Jeff Layton linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3nfsd: drop fh argument from alloc_init_delegfs/nfsd/nfs4state.c+6 -80 replies
2/3nfsd: rework arguments to nfs4_set_delegationfs/nfsd/nfs4state.c+5 -34 replies
3/3nfsd: vet the opened dentry after setting a delegationfs/nfsd/nfs4state.c+50 -54 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation

Here's a first stab at a patchset to close a potential race when setting a delegation on a file. Between the point where we open the file and where we set the delegation, another task or client could unlink or rename the dentry. If that occurs, we shouldn't hand out a delegation in the open response, but we don't prevent that today.

The basic idea here is to re-do the lookup after setting the delegation. If the resulting dentry is not the one we have in the open, then we can reject handing out a delegation.

Only lightly tested, so this is an RFC for now.

Jeff Layton (3):
nfsd: drop fh argument from alloc_init_deleg
nfsd: rework arguments to nfs4_set_delegation
nfsd: vet the opened dentry after setting a delegation

 fs/nfsd/nfs4state.c | 65 ++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 55 insertions(+), 10 deletions(-)
Signature · 1 line
2.36.1