]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 6 Jan 2021 19:13:22 +0000 (14:13 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 10 Jan 2021 18:32:52 +0000 (13:32 -0500)
If we exit _lgopen_prepare_attached() without setting a layout, we will
currently leak the plh_outstanding counter.

Fixes: 411ae722d10a ("pNFS: Wait for stale layoutget calls to complete in pnfs_update_layout()")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/pnfs.c

index fc13a3c8bc483aea7098731a5922bfda8161a584..4f274f21c4abcb9c2d96bc4088c3f1f4003258f0 100644 (file)
@@ -2244,6 +2244,7 @@ static void _lgopen_prepare_attached(struct nfs4_opendata *data,
                                             &rng, GFP_KERNEL);
        if (!lgp) {
                pnfs_clear_first_layoutget(lo);
+               nfs_layoutget_end(lo);
                pnfs_put_layout_hdr(lo);
                return;
        }