提交 4816fdad 编写于 作者: T Trond Myklebust

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: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 516285eb
...@@ -721,14 +721,12 @@ int nfs_async_inode_return_delegation(struct inode *inode, ...@@ -721,14 +721,12 @@ int nfs_async_inode_return_delegation(struct inode *inode,
struct nfs_client *clp = server->nfs_client; struct nfs_client *clp = server->nfs_client;
struct nfs_delegation *delegation; struct nfs_delegation *delegation;
filemap_flush(inode->i_mapping);
rcu_read_lock(); rcu_read_lock();
delegation = rcu_dereference(NFS_I(inode)->delegation); delegation = rcu_dereference(NFS_I(inode)->delegation);
if (delegation == NULL) if (delegation == NULL)
goto out_enoent; goto out_enoent;
if (stateid != NULL &&
if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid)) !clp->cl_mvops->match_stateid(&delegation->stateid, stateid))
goto out_enoent; goto out_enoent;
nfs_mark_return_delegation(server, delegation); nfs_mark_return_delegation(server, delegation);
rcu_read_unlock(); rcu_read_unlock();
......
...@@ -362,11 +362,9 @@ static int nfs4_do_handle_exception(struct nfs_server *server, ...@@ -362,11 +362,9 @@ static int nfs4_do_handle_exception(struct nfs_server *server,
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
if (inode && nfs4_have_delegation(inode, FMODE_READ)) { if (inode && nfs_async_inode_return_delegation(inode,
nfs4_inode_return_delegation(inode); NULL) == 0)
exception->retry = 1; goto wait_on_recovery;
return 0;
}
if (state == NULL) if (state == NULL)
break; break;
ret = nfs4_schedule_stateid_recovery(server, state); ret = nfs4_schedule_stateid_recovery(server, state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册