diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-12-28 10:32:11 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-12-28 14:33:03 -0500 |
commit | ab7d763e477c5be33ac9cffc68e808bbd69371f7 (patch) | |
tree | 85d5e407fa8f21091353b832851fcb11a371f238 /fs/nfs | |
parent | f4848303ce125999886535323a64db26dba68293 (diff) |
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: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 18d862db15b6..fcd7a9039020 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -7760,6 +7760,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata) | |||
7760 | struct nfs4_layoutget *lgp = calldata; | 7760 | struct nfs4_layoutget *lgp = calldata; |
7761 | struct nfs_server *server = NFS_SERVER(lgp->args.inode); | 7761 | struct nfs_server *server = NFS_SERVER(lgp->args.inode); |
7762 | struct nfs4_session *session = nfs4_get_session(server); | 7762 | struct nfs4_session *session = nfs4_get_session(server); |
7763 | int ret; | ||
7763 | 7764 | ||
7764 | dprintk("--> %s\n", __func__); | 7765 | dprintk("--> %s\n", __func__); |
7765 | /* Note the is a race here, where a CB_LAYOUTRECALL can come in | 7766 | /* 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 | if (nfs41_setup_sequence(session, &lgp->args.seq_args, | 7771 | if (nfs41_setup_sequence(session, &lgp->args.seq_args, |
7771 | &lgp->res.seq_res, task)) | 7772 | &lgp->res.seq_res, task)) |
7772 | return; | 7773 | return; |
7773 | if (pnfs_choose_layoutget_stateid(&lgp->args.stateid, | 7774 | ret = pnfs_choose_layoutget_stateid(&lgp->args.stateid, |
7774 | NFS_I(lgp->args.inode)->layout, | 7775 | NFS_I(lgp->args.inode)->layout, |
7775 | &lgp->args.range, | 7776 | &lgp->args.range, |
7776 | lgp->args.ctx->state)) { | 7777 | lgp->args.ctx->state); |
7777 | rpc_exit(task, NFS4_OK); | 7778 | if (ret < 0) |
7778 | } | 7779 | rpc_exit(task, ret); |
7779 | } | 7780 | } |
7780 | 7781 | ||
7781 | static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) | 7782 | static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) |