diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-02-13 07:55:31 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-03-01 22:37:37 -0500 |
commit | 18c0778a650b21f8729576b7bc382447d2027d4d (patch) | |
tree | b2ac7087d2d209ad2f5177d2cffb1725b3a42241 /fs/nfs | |
parent | f0922a6c0cdb928d21c2599f9671206237e7e505 (diff) | |
download | linux-18c0778a650b21f8729576b7bc382447d2027d4d.tar.gz linux-18c0778a650b21f8729576b7bc382447d2027d4d.tar.bz2 linux-18c0778a650b21f8729576b7bc382447d2027d4d.zip |
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: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 73889ea7d196..4dbb0ee23432 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -8936,10 +8936,12 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) if (status != 0) goto out; - /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */ - if (task->tk_status < 0 || lgp->res.layoutp->len == 0) { + if (task->tk_status < 0) { status = nfs4_layoutget_handle_exception(task, lgp, &exception); *timeout = exception.timeout; + } else if (lgp->res.layoutp->len == 0) { + status = -EAGAIN; + *timeout = nfs4_update_delay(&exception.timeout); } else lseg = pnfs_layout_process(lgp); out: |