Commit 18c0778a authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Handle early exit in layoutget by returning an error

If the LAYOUTGET rpc call exits early without an error, convert it to
EAGAIN.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent f0922a6c
...@@ -8936,10 +8936,12 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) ...@@ -8936,10 +8936,12 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout)
if (status != 0) if (status != 0)
goto out; goto out;
/* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */ if (task->tk_status < 0) {
if (task->tk_status < 0 || lgp->res.layoutp->len == 0) {
status = nfs4_layoutget_handle_exception(task, lgp, &exception); status = nfs4_layoutget_handle_exception(task, lgp, &exception);
*timeout = exception.timeout; *timeout = exception.timeout;
} else if (lgp->res.layoutp->len == 0) {
status = -EAGAIN;
*timeout = nfs4_update_delay(&exception.timeout);
} else } else
lseg = pnfs_layout_process(lgp); lseg = pnfs_layout_process(lgp);
out: out:
......
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