aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-01-26 15:50:41 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2017-01-26 15:50:41 -0500
commitee6625a948d2e47267ec8fd97307fdd67d0f8a5b (patch)
treeb12ad012131b8fee01e663da1cc9937e2af16851
parent406dab8450ec76eca88a1af2fc15d18a2b36ca49 (diff)
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 <aglo@umich.edu> Fixes: 24408f5282 ("pNFS: Fix bugs in _pnfs_return_layout") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/pnfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 59554f3adf29..dd042498ce7c 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1200,10 +1200,10 @@ _pnfs_return_layout(struct inode *ino)
1200 1200
1201 send = pnfs_prepare_layoutreturn(lo, &stateid, NULL); 1201 send = pnfs_prepare_layoutreturn(lo, &stateid, NULL);
1202 spin_unlock(&ino->i_lock); 1202 spin_unlock(&ino->i_lock);
1203 pnfs_free_lseg_list(&tmp_list);
1204 if (send) 1203 if (send)
1205 status = pnfs_send_layoutreturn(lo, &stateid, IOMODE_ANY, true); 1204 status = pnfs_send_layoutreturn(lo, &stateid, IOMODE_ANY, true);
1206out_put_layout_hdr: 1205out_put_layout_hdr:
1206 pnfs_free_lseg_list(&tmp_list);
1207 pnfs_put_layout_hdr(lo); 1207 pnfs_put_layout_hdr(lo);
1208out: 1208out:
1209 dprintk("<-- %s status: %d\n", __func__, status); 1209 dprintk("<-- %s status: %d\n", __func__, status);