Skip to content

Commit dba0d4b

Browse files
Trond Myklebustgregkh
authored andcommitted
pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()
[ Upstream commit 814b849 ] 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: 9888d83 ("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>
1 parent ae02c00 commit dba0d4b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfs/pnfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
24182418
spin_unlock(&ino->i_lock);
24192419
lseg->pls_layout = lo;
24202420
NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg);
2421+
pnfs_free_lseg_list(&free_me);
24212422
return ERR_PTR(-EAGAIN);
24222423
}
24232424

0 commit comments

Comments
 (0)