summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-01-21 16:34:37 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-03 23:23:26 +0100
commit8a9ccffb3c1a6ecbfa2c811fe329f8220696dbc0 (patch)
tree251120d70d3ea5bcb6aacbc0bff248a06ba4fd88 /fs/nfs
parentf518b796f494d11e053600495da9ad9bb4806d19 (diff)
downloadlinux-stable-8a9ccffb3c1a6ecbfa2c811fe329f8220696dbc0.tar.gz
linux-stable-8a9ccffb3c1a6ecbfa2c811fe329f8220696dbc0.tar.bz2
linux-stable-8a9ccffb3c1a6ecbfa2c811fe329f8220696dbc0.zip
pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()
[ Upstream commit 814b84971388cd5fb182f2e914265b3827758455 ] If the server returns a new stateid that does not match the one in our cache, then pnfs_layout_process() will leak the layout segments returned by pnfs_mark_layout_stateid_invalid(). Fixes: 9888d837f3cf ("pNFS: Force a retry of LAYOUTGET if the stateid doesn't match our cache") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/pnfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 46ca5592b8b0..4b165aa5a256 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2320,6 +2320,7 @@ out_forget:
spin_unlock(&ino->i_lock);
lseg->pls_layout = lo;
NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg);
+ pnfs_free_lseg_list(&free_me);
return ERR_PTR(-EAGAIN);
}