aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-01-21 16:34:37 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-01-24 20:52:30 -0500
commit814b84971388cd5fb182f2e914265b3827758455 (patch)
tree8ea5e8f9f5b6e696b8174167b60b5a180cfc0fc1 /fs/nfs/pnfs.c
parentLinux 5.11-rc5 (diff)
downloadlinux-dev-814b84971388cd5fb182f2e914265b3827758455.tar.xz
linux-dev-814b84971388cd5fb182f2e914265b3827758455.zip
pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()
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>
Diffstat (limited to 'fs/nfs/pnfs.c')
-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 4f274f21c4ab..e68e6f8cb407 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -2417,6 +2417,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);
}