Skip to content

Commit

Permalink
NFS/pNFS: Fix a leak of the layout 'plh_outstanding' counter
Browse files Browse the repository at this point in the history
commit cb2856c upstream.

If we exit _lgopen_prepare_attached() without setting a layout, we will
currently leak the plh_outstanding counter.

Fixes: 411ae72 ("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>
  • Loading branch information
Trond Myklebust authored and gregkh committed Jan 19, 2021
1 parent b666f39 commit 01a12a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfs/pnfs.c
Expand Up @@ -2245,6 +2245,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;
}
Expand Down

0 comments on commit 01a12a2

Please sign in to comment.