aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-09-20 14:58:42 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-10-08 10:45:53 -0400
commit4816fdadab9ff874ec1a4138dad43b636c7d220b (patch)
treec00606037841cb80e621fa7c5072146952b754f5 /fs/nfs
parent516285ebe0efadc40b914a0e61a913a390604810 (diff)
NFSv4: Don't use synchronous delegation recall in exception handling
The code needs to be able to work from inside an asynchronous context. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/delegation.c6
-rw-r--r--fs/nfs/nfs4proc.c8
2 files changed, 5 insertions, 9 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index be806ead7f4d..5166adcfc0fb 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -721,14 +721,12 @@ int nfs_async_inode_return_delegation(struct inode *inode,
721 struct nfs_client *clp = server->nfs_client; 721 struct nfs_client *clp = server->nfs_client;
722 struct nfs_delegation *delegation; 722 struct nfs_delegation *delegation;
723 723
724 filemap_flush(inode->i_mapping);
725
726 rcu_read_lock(); 724 rcu_read_lock();
727 delegation = rcu_dereference(NFS_I(inode)->delegation); 725 delegation = rcu_dereference(NFS_I(inode)->delegation);
728 if (delegation == NULL) 726 if (delegation == NULL)
729 goto out_enoent; 727 goto out_enoent;
730 728 if (stateid != NULL &&
731 if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid)) 729 !clp->cl_mvops->match_stateid(&delegation->stateid, stateid))
732 goto out_enoent; 730 goto out_enoent;
733 nfs_mark_return_delegation(server, delegation); 731 nfs_mark_return_delegation(server, delegation);
734 rcu_read_unlock(); 732 rcu_read_unlock();
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ae5cde621954..2a155ec05f6d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -362,11 +362,9 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
362 case -NFS4ERR_DELEG_REVOKED: 362 case -NFS4ERR_DELEG_REVOKED:
363 case -NFS4ERR_ADMIN_REVOKED: 363 case -NFS4ERR_ADMIN_REVOKED:
364 case -NFS4ERR_BAD_STATEID: 364 case -NFS4ERR_BAD_STATEID:
365 if (inode && nfs4_have_delegation(inode, FMODE_READ)) { 365 if (inode && nfs_async_inode_return_delegation(inode,
366 nfs4_inode_return_delegation(inode); 366 NULL) == 0)
367 exception->retry = 1; 367 goto wait_on_recovery;
368 return 0;
369 }
370 if (state == NULL) 368 if (state == NULL)
371 break; 369 break;
372 ret = nfs4_schedule_stateid_recovery(server, state); 370 ret = nfs4_schedule_stateid_recovery(server, state);