]> git.ipfire.org Git - people/arne_f/kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:26:17 +0000 (18:26 +0100)
commit cb2856c5971723910a86b7d1d0cf623d6919cbc4 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs.c

index daf55101e90e44b4d81ef11fe2e8d2438deaae7a..4232f956bdac0a731bfd9e3d4db27fdba6d0c3d4 100644 (file)
@@ -2215,6 +2215,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;
        }