aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorAlexandros Batsakis <batsakis@netapp.com>2009-12-05 13:48:55 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-12-05 13:48:55 -0500
commit2597641deae82c9a95e255518da189ab557da0af (patch)
tree0b2dc7c46f2a0398ecefd6bb63a657710cf921fa /fs/nfs/delegation.c
parent0629e370dd5819efa5cf8d418a8e6729efe388ef (diff)
nfs41: v2 fix cb_recall bug
in NFSv4.1 the seqid part of a stateid in CB_RECALL must be 0 Signed-off-by: Alexandros Batsakis <batsakis@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index f4758ec42138..2563bebc4c67 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -454,18 +454,21 @@ void nfs_expire_unreferenced_delegations(struct nfs_client *clp)
454/* 454/*
455 * Asynchronous delegation recall! 455 * Asynchronous delegation recall!
456 */ 456 */
457int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid) 457int nfs_async_inode_return_delegation(struct inode *inode, const nfs4_stateid *stateid,
458 int (*validate_stateid)(struct nfs_delegation *delegation,
459 const nfs4_stateid *stateid))
458{ 460{
459 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client; 461 struct nfs_client *clp = NFS_SERVER(inode)->nfs_client;
460 struct nfs_delegation *delegation; 462 struct nfs_delegation *delegation;
461 463
462 rcu_read_lock(); 464 rcu_read_lock();
463 delegation = rcu_dereference(NFS_I(inode)->delegation); 465 delegation = rcu_dereference(NFS_I(inode)->delegation);
464 if (delegation == NULL || memcmp(delegation->stateid.data, stateid->data, 466
465 sizeof(delegation->stateid.data)) != 0) { 467 if (!validate_stateid(delegation, stateid)) {
466 rcu_read_unlock(); 468 rcu_read_unlock();
467 return -ENOENT; 469 return -ENOENT;
468 } 470 }
471
469 nfs_mark_return_delegation(clp, delegation); 472 nfs_mark_return_delegation(clp, delegation);
470 rcu_read_unlock(); 473 rcu_read_unlock();
471 nfs_delegation_run_state_manager(clp); 474 nfs_delegation_run_state_manager(clp);