public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()
@ 2021-01-25  1:54 trondmy
  2021-01-25  1:54 ` [PATCH 2/4] pNFS/NFSv4: Try to return invalid layout " trondmy
  0 siblings, 1 reply; 4+ messages in thread
From: trondmy @ 2021-01-25  1:54 UTC (permalink / raw)
  To: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

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>
---
 fs/nfs/pnfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 4f274f21c4ab..e68e6f8cb407 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2417,6 +2417,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
 	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);
 }
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-25  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-25  1:54 [PATCH 1/4] pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process() trondmy
2021-01-25  1:54 ` [PATCH 2/4] pNFS/NFSv4: Try to return invalid layout " trondmy
2021-01-25  1:54   ` [PATCH 3/4] pNFS/NFSv4: Update the layout barrier when we schedule a layoutreturn trondmy
2021-01-25  1:54     ` [PATCH 4/4] pNFS/NFSv4: Improve rejection of out-of-order layouts trondmy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox