Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee6625a9 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

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: default avatarOlga Kornievskaia <aglo@umich.edu>
Fixes: 24408f52 ("pNFS: Fix bugs in _pnfs_return_layout")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 406dab84
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1200,10 +1200,10 @@ _pnfs_return_layout(struct inode *ino)

	send = pnfs_prepare_layoutreturn(lo, &stateid, NULL);
	spin_unlock(&ino->i_lock);
	pnfs_free_lseg_list(&tmp_list);
	if (send)
		status = pnfs_send_layoutreturn(lo, &stateid, IOMODE_ANY, true);
out_put_layout_hdr:
	pnfs_free_lseg_list(&tmp_list);
	pnfs_put_layout_hdr(lo);
out:
	dprintk("<-- %s status: %d\n", __func__, status);