Skip to content

Commit 079da28

Browse files
Dave ChinnerBen Myers
authored andcommitted
xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near
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]>
1 parent 76e8f13 commit 079da28

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/xfs/xfs_alloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ xfs_alloc_ag_vextent_near(
10801080
goto restart;
10811081
}
10821082

1083+
xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
10831084
trace_xfs_alloc_size_neither(args);
10841085
args->agbno = NULLAGBLOCK;
10851086
return 0;

0 commit comments

Comments
 (0)