diff mbox series

[v2,7/7] NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter

Message ID 20210107053130.20341-7-trondmy@kernel.org (mailing list archive)
State New
Headers show
Series [v2,1/7] pNFS: Mark layout for return if return-on-close was not sent | expand

Commit Message

trondmy@kernel.org Jan. 7, 2021, 5:31 a.m. UTC
From: Trond Myklebust <trond.myklebust@hammerspace.com>

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 | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


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) {
+		nfs_layoutget_end(lo);