From: Trond Myklebust Date: Wed, 6 Jan 2021 19:13:22 +0000 (-0500) Subject: NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter X-Git-Tag: iomap-folio-5.17-old~2286^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cb2856c5971723910a86b7d1d0cf623d6919cbc4;p=users%2Fwilly%2Flinux.git NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter 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 --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index fc13a3c8bc48..4f274f21c4ab 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -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; }