Skip to content

Commit

Permalink
xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near
Browse files Browse the repository at this point in the history
When we fail to find an matching extent near the requested extent
specification during a left-right distance search in
xfs_alloc_ag_vextent_near, we fail to free the original cursor that
we used to look up the XFS_BTNUM_CNT tree and hence leak it.

Reported-by: Chris J Arges <[email protected]>
Signed-off-by: Dave Chinner <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Ben Myers <[email protected]>
  • Loading branch information
Dave Chinner authored and Ben Myers committed Jun 21, 2012
1 parent 9a3a5da commit 76d0953
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/xfs/xfs_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,7 @@ xfs_alloc_ag_vextent_near(
goto restart;
}

xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
trace_xfs_alloc_size_neither(args);
args->agbno = NULLAGBLOCK;
return 0;
Expand Down

0 comments on commit 76d0953

Please sign in to comment.