提交 53e6fc86 编写于 作者: T Trond Myklebust

pNFS: Prevent unnecessary layoutreturns after delegreturn

If we cannot grab the inode or superblock, then we cannot pin the
layout header, and so we cannot send a layoutreturn as part of an
async delegreturn call. In this case, we currently end up sending
an extra layoutreturn after the delegreturn. Since the layout was
implicitly returned by the delegreturn, that just gets a BAD_STATEID.

The fix is to simply complete the return-on-close immediately.
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 1c5bd76d
...@@ -5744,14 +5744,16 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co ...@@ -5744,14 +5744,16 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co
nfs_fattr_init(data->res.fattr); nfs_fattr_init(data->res.fattr);
data->timestamp = jiffies; data->timestamp = jiffies;
data->rpc_status = 0; data->rpc_status = 0;
data->lr.roc = pnfs_roc(inode, &data->lr.arg, &data->lr.res, cred);
data->inode = nfs_igrab_and_active(inode); data->inode = nfs_igrab_and_active(inode);
if (data->inode) { if (data->inode) {
data->lr.roc = pnfs_roc(inode, &data->lr.arg, &data->lr.res,
cred);
if (data->lr.roc) { if (data->lr.roc) {
data->args.lr_args = &data->lr.arg; data->args.lr_args = &data->lr.arg;
data->res.lr_res = &data->lr.res; data->res.lr_res = &data->lr.res;
} }
} else if (data->lr.roc) {
pnfs_roc_release(&data->lr.arg, &data->lr.res, 0);
data->lr.roc = false;
} }
task_setup_data.callback_data = data; task_setup_data.callback_data = data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册