Commit ab7d763e authored by Trond Myklebust's avatar Trond Myklebust

pNFS: Ensure nfs4_layoutget_prepare returns the correct error

If we're unable to perform the layoutget due to an invalid open stateid
or a bulk recall, ensure that we return the error so that the caller
can decide on an appropriate action.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent f4848303
...@@ -7760,6 +7760,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata) ...@@ -7760,6 +7760,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
struct nfs4_layoutget *lgp = calldata; struct nfs4_layoutget *lgp = calldata;
struct nfs_server *server = NFS_SERVER(lgp->args.inode); struct nfs_server *server = NFS_SERVER(lgp->args.inode);
struct nfs4_session *session = nfs4_get_session(server); struct nfs4_session *session = nfs4_get_session(server);
int ret;
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
/* Note the is a race here, where a CB_LAYOUTRECALL can come in /* Note the is a race here, where a CB_LAYOUTRECALL can come in
...@@ -7770,12 +7771,12 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata) ...@@ -7770,12 +7771,12 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
if (nfs41_setup_sequence(session, &lgp->args.seq_args, if (nfs41_setup_sequence(session, &lgp->args.seq_args,
&lgp->res.seq_res, task)) &lgp->res.seq_res, task))
return; return;
if (pnfs_choose_layoutget_stateid(&lgp->args.stateid, ret = pnfs_choose_layoutget_stateid(&lgp->args.stateid,
NFS_I(lgp->args.inode)->layout, NFS_I(lgp->args.inode)->layout,
&lgp->args.range, &lgp->args.range,
lgp->args.ctx->state)) { lgp->args.ctx->state);
rpc_exit(task, NFS4_OK); if (ret < 0)
} rpc_exit(task, ret);
} }
static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
......
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