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

Commit 76d09538 authored by Dave Chinner's avatar Dave Chinner Committed by Ben Myers
Browse files

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: default avatarChris J Arges <chris.j.arges@canonical.com>
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent 9a3a5dab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;