Skip to content

Commit ee6625a

Browse files
committed
pNFS: Fix a reference leak in _pnfs_return_layout
IF NFS_LAYOUT_RETURN_REQUESTED is not set, then we currently exit without freeing the list of invalidated layout segments, leading to a reference leak. Reported-by: Olga Kornievskaia <[email protected]> Fixes: 24408f5 ("pNFS: Fix bugs in _pnfs_return_layout") Signed-off-by: Trond Myklebust <[email protected]>
1 parent 406dab8 commit ee6625a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/pnfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,10 +1200,10 @@ _pnfs_return_layout(struct inode *ino)
12001200

12011201
send = pnfs_prepare_layoutreturn(lo, &stateid, NULL);
12021202
spin_unlock(&ino->i_lock);
1203-
pnfs_free_lseg_list(&tmp_list);
12041203
if (send)
12051204
status = pnfs_send_layoutreturn(lo, &stateid, IOMODE_ANY, true);
12061205
out_put_layout_hdr:
1206+
pnfs_free_lseg_list(&tmp_list);
12071207
pnfs_put_layout_hdr(lo);
12081208
out:
12091209
dprintk("<-- %s status: %d\n", __func__, status);

0 commit comments

Comments
 (0)