linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] Fix NFSv4 delegations
@ 2012-01-17 16:00 J. Bruce Fields
       [not found] ` <1326816029-13913-1-git-send-email-bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: J. Bruce Fields @ 2012-01-17 16:00 UTC (permalink / raw)
  To: linux-fsdevel, linux-nfs; +Cc: J. Bruce Fields

From: "J. Bruce Fields" <bfields@redhat.com>

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(-)

-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-02-03 21:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 16:00 [RFC PATCH 0/6] Fix NFSv4 delegations J. Bruce Fields
     [not found] ` <1326816029-13913-1-git-send-email-bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-01-17 16:00   ` [RFC PATCH 1/6] locks: introduce new FL_DELEG lock flag J. Bruce Fields
2012-01-17 16:00   ` [RFC PATCH 3/6] locks: break delegations on unlink J. Bruce Fields
2012-01-17 16:00   ` [RFC PATCH 6/6] locks: break delegations on link J. Bruce Fields
2012-01-17 16:00 ` [RFC PATCH 2/6] locks: give break_lease its own flags J. Bruce Fields
     [not found]   ` <1326816029-13913-3-git-send-email-bfields-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-01-17 16:17     ` Bypass encrypt and decrypt data in dm-crypt Fan Zhang
2012-01-17 16:00 ` [RFC PATCH 4/6] locks: break delegations on rename J. Bruce Fields
2012-01-17 16:00 ` [RFC PATCH 5/6] locks: break delegations on any attribute modification J. Bruce Fields
2012-02-03 20:58 ` [RFC PATCH 0/6] Fix NFSv4 delegations J. Bruce Fields
2012-02-03 21:09   ` [PATCH 1/6] locks: introduce new FL_DELEG lock flag J. Bruce Fields
     [not found]   ` <20120203205818.GE2999-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-02-03 21:09     ` Provide vfs support for NFSv4 delegations J. Bruce Fields
2012-02-03 21:09     ` [PATCH 2/6] locks: give break_lease its own flags J. Bruce Fields
2012-02-03 21:09     ` [PATCH 3/6] locks: break delegations on unlink J. Bruce Fields
2012-02-03 21:09     ` [PATCH 6/6] locks: break delegations on link J. Bruce Fields
2012-02-03 21:09   ` [PATCH 4/6] locks: break delegations on rename J. Bruce Fields
2012-02-03 21:09   ` [PATCH 5/6] locks: break delegations on any attribute modification J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).