aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-05 19:56:44 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-06 10:32:43 -0500
commita1d0b5eebc4fd6e0edb02688b35f17f67f42aea5 (patch)
tree80d13543ee4f1928e0436919a19de40be2a3b12b /fs/nfs/delegation.c
parentfa68a1ba1de349f0d1fcc54171b95236efe24148 (diff)
NFS: Properly handle the case where the delegation is revoked
If we know that the delegation stateid is bad or revoked, we need to remove that delegation as soon as possible, and then mark all the stateids that relied on that delegation for recovery. We cannot use the delegation as part of the recovery process. Also note that NFSv4.1 uses a different error code (NFS4ERR_DELEG_REVOKED) to indicate that the delegation was revoked. Finally, ensure that setlk() and setattr() can both recover safely from a revoked delegation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 7f2654069806..ac889af8ccf5 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -466,6 +466,17 @@ static void nfs_delegation_run_state_manager(struct nfs_client *clp)
466 nfs4_schedule_state_manager(clp); 466 nfs4_schedule_state_manager(clp);
467} 467}
468 468
469void nfs_remove_bad_delegation(struct inode *inode)
470{
471 struct nfs_delegation *delegation;
472
473 delegation = nfs_detach_delegation(NFS_I(inode), NFS_SERVER(inode));
474 if (delegation) {
475 nfs_inode_find_state_and_recover(inode, &delegation->stateid);
476 nfs_free_delegation(delegation);
477 }
478}
479
469/** 480/**
470 * nfs_expire_all_delegation_types 481 * nfs_expire_all_delegation_types
471 * @clp: client to process 482 * @clp: client to process