pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 21 Jan 2021 21:34:37 +0000 (16:34 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:26:00 +0000 (23:26 +0100)
commitf39fce916a7b0e6254cd8bccad7580a5a62976e8
treec202c1934011f8c75a77ce41db446cecc2941849
parenta3c5fec1e09fd9ee8c82a30a8b77921e7236f8dc
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>
fs/nfs/pnfs.c