]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 13 Nov 2019 08:39:36 +0000 (09:39 +0100)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1861934
commit 5326de9e94bedcf7366e7e7625d4deb8c1f1ca8a upstream.

If nfs4_delegreturn_prepare needs to wait for a layoutreturn to complete
then make sure we drop the sequence slot if we hold it.

Fixes: 1c5bd76d17cc ("pNFS: Enable layoutreturn operation for return-on-close")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/nfs/nfs4proc.c

index 21f8902d90738f906f47a464b0799f056c262c54..6bb3946358a7bf4101dec793571c680807f537b6 100644 (file)
@@ -5888,8 +5888,10 @@ static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data)
 
        d_data = (struct nfs4_delegreturndata *)data;
 
-       if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task))
+       if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task)) {
+               nfs4_sequence_done(task, &d_data->res.seq_res);
                return;
+       }
 
        nfs4_setup_sequence(d_data->res.server->nfs_client,
                        &d_data->args.seq_args,