Skip to content

RFC Fix NFSv4 delegations

J. Bruce Fields linux-fsdevel linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6locks: introduce new FL_DELEG lock flag.fs/locks.c fs/nfsd/nfs4state.c include/linux/fs.h+3 -20 replies
2/6locks: give break_lease its own flagsfs/locks.c fs/nfsd/vfs.c fs/open.c +1 more+50 -101 reply
4/6locks: break delegations on renameDocumentation/filesystems/directory-locking fs/namei.c include/linux/fs.h+27 -100 replies
4/6locks: break delegations on renameDocumentation/filesystems/directory-locking fs/namei.c include/linux/fs.h+24 -80 replies
5/6locks: break delegations on any attribute modificationfs/attr.c+3 -00 replies
5/6locks: break delegations on any attribute modificationfs/attr.c+3 -00 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/6] Fix NFSv4 delegations

From: "J. Bruce Fields" <[email protected]>

NFSv4 delegations are currently implemented as leases. However, leases don't have quite the same semantics, which means that delegations are currently enforced correctly only for conflicts between NFSv4 clients.

I previously attempted to address this by "fixing" the existing lease behavior, assuming it was a bug--but from further investigation it looks like that would be the wrong thing to do for Samba.

So instead I'm defining a new FL_DELEG flag to mark NFSv4 delegations, and varying behavior based on that. Delegations aren't meant to be available to userspace for now--nfsd is the only user.

In theory this code allows both read and write delegations, but I'm only using read delegations for now--write delegations are a project for another day. (At which point write leases will probably need some fixing while we're at it.)

Still to do: if OPEN(dirfd, name) returns a delegation to the client, then the client should be guaranteed that the opened file is still linked as (dirfd, name). But the current nfsd code allows a rename or unlink to intervene between the lookup and the request for a delegation.

--b.

J. Bruce Fields (6):
locks: introduce new FL_DELEG lock flag.
locks: give break_lease its own flags
locks: break delegations on unlink
locks: break delegations on rename
locks: break delegations on any attribute modification
locks: break delegations on link

 Documentation/filesystems/directory-locking |   11 +++---
 fs/attr.c                                   |    3 ++
 fs/locks.c                                  |   51 +++++++++++++++++++-------
 fs/namei.c                                  |   27 ++++++++++++--
 fs/nfsd/nfs4state.c                         |    2 +-
 fs/nfsd/vfs.c                               |    6 ++--
 fs/open.c                                   |    4 +-
 include/linux/fs.h                          |   50 ++++++++++++++++++++++++--
 8 files changed, 122 insertions(+), 32 deletions(-)
Signature · 1 line
1.7.5.4