Commit 91b30d2e authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

NFSv4: cleanup nfs4_close_done

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent ff90514e
...@@ -3168,11 +3168,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data) ...@@ -3168,11 +3168,8 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
break; break;
case -NFS4ERR_OLD_STATEID: case -NFS4ERR_OLD_STATEID:
if (nfs4_refresh_layout_stateid(&calldata->arg.lr_args->stateid, if (nfs4_refresh_layout_stateid(&calldata->arg.lr_args->stateid,
calldata->inode)) { calldata->inode))
calldata->res.lr_ret = 0; goto lr_restart;
rpc_restart_call_prepare(task);
return;
}
/* Fallthrough */ /* Fallthrough */
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_DELEG_REVOKED: case -NFS4ERR_DELEG_REVOKED:
...@@ -3182,9 +3179,7 @@ static void nfs4_close_done(struct rpc_task *task, void *data) ...@@ -3182,9 +3179,7 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
case -NFS4ERR_WRONG_CRED: case -NFS4ERR_WRONG_CRED:
calldata->arg.lr_args = NULL; calldata->arg.lr_args = NULL;
calldata->res.lr_res = NULL; calldata->res.lr_res = NULL;
calldata->res.lr_ret = 0; goto lr_restart;
rpc_restart_call_prepare(task);
return;
} }
} }
...@@ -3200,19 +3195,15 @@ static void nfs4_close_done(struct rpc_task *task, void *data) ...@@ -3200,19 +3195,15 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
if (calldata->arg.bitmask != NULL) { if (calldata->arg.bitmask != NULL) {
calldata->arg.bitmask = NULL; calldata->arg.bitmask = NULL;
calldata->res.fattr = NULL; calldata->res.fattr = NULL;
task->tk_status = 0; goto out_restart;
rpc_restart_call_prepare(task);
goto out_release;
} }
break; break;
case -NFS4ERR_OLD_STATEID: case -NFS4ERR_OLD_STATEID:
/* Did we race with OPEN? */ /* Did we race with OPEN? */
if (nfs4_refresh_open_stateid(&calldata->arg.stateid, if (nfs4_refresh_open_stateid(&calldata->arg.stateid,
state)) { state))
task->tk_status = 0; goto out_restart;
rpc_restart_call_prepare(task);
}
goto out_release; goto out_release;
case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_STALE_STATEID: case -NFS4ERR_STALE_STATEID:
...@@ -3224,17 +3215,23 @@ static void nfs4_close_done(struct rpc_task *task, void *data) ...@@ -3224,17 +3215,23 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
case -NFS4ERR_BAD_STATEID: case -NFS4ERR_BAD_STATEID:
break; break;
default: default:
if (nfs4_async_handle_error(task, server, state, NULL) == -EAGAIN) { if (nfs4_async_handle_error(task, server, state, NULL) == -EAGAIN)
rpc_restart_call_prepare(task); goto out_restart;
goto out_release;
}
} }
nfs_clear_open_stateid(state, &calldata->arg.stateid, nfs_clear_open_stateid(state, &calldata->arg.stateid,
res_stateid, calldata->arg.fmode); res_stateid, calldata->arg.fmode);
out_release: out_release:
task->tk_status = 0;
nfs_release_seqid(calldata->arg.seqid); nfs_release_seqid(calldata->arg.seqid);
nfs_refresh_inode(calldata->inode, &calldata->fattr); nfs_refresh_inode(calldata->inode, &calldata->fattr);
dprintk("%s: done, ret = %d!\n", __func__, task->tk_status); dprintk("%s: done, ret = %d!\n", __func__, task->tk_status);
return;
lr_restart:
calldata->res.lr_ret = 0;
out_restart:
task->tk_status = 0;
rpc_restart_call_prepare(task);
goto out_release;
} }
static void nfs4_close_prepare(struct rpc_task *task, void *data) static void nfs4_close_prepare(struct rpc_task *task, void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment