linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/20] Delegation bugfixes
@ 2019-10-31 22:40 Trond Myklebust
  2019-10-31 22:40 ` [PATCH v2 01/20] NFSv4: Don't allow a cached open with a revoked delegation Trond Myklebust
  0 siblings, 1 reply; 21+ messages in thread
From: Trond Myklebust @ 2019-10-31 22:40 UTC (permalink / raw)
  To: linux-nfs

The following patchset fixes up a number of issues with delegations,
but mainly attempts to fix a race condition between open and
delegreturn, where the open and the delegreturn get re-ordered so
that the delegreturn ends up revoking the delegation that was returned
by the open.
The root cause is that in certain circumstances, we may currently end
up freeing the delegation from delegreturn, so when we later receive
the reply to the open, we've lost track of the fact that the seqid
predates the one that was returned.

This patchset fixes that case by ensuring that we always keep track
of the last delegation stateid that was returned for any given inode.
That way, if we later see a delegation stateid with the same opaque
field, but an older seqid, we know we cannot trust it, and so we
ask to replay the OPEN compound.

Trond Myklebust (20):
  NFSv4: Don't allow a cached open with a revoked delegation
  NFS: Fix an RCU lock leak in nfs4_refresh_delegation_stateid()
  NFSv4: Fix delegation handling in update_open_stateid()
  NFSv4: nfs4_callback_getattr() should ignore revoked delegations
  NFSv4: Delegation recalls should not find revoked delegations
  NFSv4: fail nfs4_refresh_delegation_stateid() when the delegation was
    revoked
  NFS: Rename nfs_inode_return_delegation_noreclaim()
  NFSv4: Don't remove the delegation from the super_list more than once
  NFSv4: Hold the delegation spinlock when updating the seqid
  NFSv4: Clear the NFS_DELEGATION_REVOKED flag in
    nfs_update_inplace_delegation()
  NFSv4: Update the stateid seqid in nfs_revoke_delegation()
  NFSv4: Revoke the delegation on success in nfs4_delegreturn_done()
  NFSv4: Ignore requests to return the delegation if it was revoked
  NFSv4: Don't reclaim delegations that have been returned or revoked
  NFSv4: nfs4_return_incompatible_delegation() should check delegation
    validity
  NFSv4: Fix nfs4_inode_make_writeable()
  NFS: nfs_inode_find_state_and_recover() fix stateid matching
  NFSv4: Fix races between open and delegreturn
  NFSv4: Handle NFS4ERR_OLD_STATEID in delegreturn
  NFSv4: Don't retry the GETATTR on old stateid in
    nfs4_delegreturn_done()

 fs/nfs/callback_proc.c |   4 +-
 fs/nfs/delegation.c    | 170 +++++++++++++++++++++++++++++------------
 fs/nfs/delegation.h    |   4 +-
 fs/nfs/nfs4_fs.h       |   6 ++
 fs/nfs/nfs4proc.c      |  25 +++---
 fs/nfs/nfs4state.c     |   7 +-
 fs/nfs/nfs4super.c     |   4 +-
 7 files changed, 151 insertions(+), 69 deletions(-)

-- 
2.23.0


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

end of thread, other threads:[~2019-10-31 22:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 22:40 [PATCH v2 00/20] Delegation bugfixes Trond Myklebust
2019-10-31 22:40 ` [PATCH v2 01/20] NFSv4: Don't allow a cached open with a revoked delegation Trond Myklebust
2019-10-31 22:40   ` [PATCH v2 02/20] NFS: Fix an RCU lock leak in nfs4_refresh_delegation_stateid() Trond Myklebust
2019-10-31 22:40     ` [PATCH v2 03/20] NFSv4: Fix delegation handling in update_open_stateid() Trond Myklebust
2019-10-31 22:40       ` [PATCH v2 04/20] NFSv4: nfs4_callback_getattr() should ignore revoked delegations Trond Myklebust
2019-10-31 22:40         ` [PATCH v2 05/20] NFSv4: Delegation recalls should not find " Trond Myklebust
2019-10-31 22:40           ` [PATCH v2 06/20] NFSv4: fail nfs4_refresh_delegation_stateid() when the delegation was revoked Trond Myklebust
2019-10-31 22:40             ` [PATCH v2 07/20] NFS: Rename nfs_inode_return_delegation_noreclaim() Trond Myklebust
2019-10-31 22:40               ` [PATCH v2 08/20] NFSv4: Don't remove the delegation from the super_list more than once Trond Myklebust
2019-10-31 22:40                 ` [PATCH v2 09/20] NFSv4: Hold the delegation spinlock when updating the seqid Trond Myklebust
2019-10-31 22:40                   ` [PATCH v2 10/20] NFSv4: Clear the NFS_DELEGATION_REVOKED flag in nfs_update_inplace_delegation() Trond Myklebust
2019-10-31 22:40                     ` [PATCH v2 11/20] NFSv4: Update the stateid seqid in nfs_revoke_delegation() Trond Myklebust
2019-10-31 22:40                       ` [PATCH v2 12/20] NFSv4: Revoke the delegation on success in nfs4_delegreturn_done() Trond Myklebust
2019-10-31 22:40                         ` [PATCH v2 13/20] NFSv4: Ignore requests to return the delegation if it was revoked Trond Myklebust
2019-10-31 22:40                           ` [PATCH v2 14/20] NFSv4: Don't reclaim delegations that have been returned or revoked Trond Myklebust
2019-10-31 22:40                             ` [PATCH v2 15/20] NFSv4: nfs4_return_incompatible_delegation() should check delegation validity Trond Myklebust
2019-10-31 22:40                               ` [PATCH v2 16/20] NFSv4: Fix nfs4_inode_make_writeable() Trond Myklebust
2019-10-31 22:40                                 ` [PATCH v2 17/20] NFS: nfs_inode_find_state_and_recover() fix stateid matching Trond Myklebust
2019-10-31 22:40                                   ` [PATCH v2 18/20] NFSv4: Fix races between open and delegreturn Trond Myklebust
2019-10-31 22:40                                     ` [PATCH v2 19/20] NFSv4: Handle NFS4ERR_OLD_STATEID in delegreturn Trond Myklebust
2019-10-31 22:40                                       ` [PATCH v2 20/20] NFSv4: Don't retry the GETATTR on old stateid in nfs4_delegreturn_done() Trond Myklebust

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