]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
NFSv4: Handle early exit in layoutget by returning an error
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 13 Feb 2019 12:55:31 +0000 (07:55 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 2 Mar 2019 03:37:37 +0000 (22:37 -0500)
If the LAYOUTGET rpc call exits early without an error, convert it to
EAGAIN.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c

index 73889ea7d196a43fb4e4a4f6643eae9041edc63b..4dbb0ee234324db3275de7c7a26fc3bcd040171a 100644 (file)
@@ -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: