Skip to content

Commit d8a823c

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: free xfs_busy_extents structure when no RT extents are queued
kmemleak occasionally reports leaking xfs_busy_extents structure from xfs_scrub calls after running xfs/528 (but attributed to following tests), which seems to be caused by not freeing the xfs_busy_extents structure when tr.queued is 0 and xfs_trim_rtgroup_extents breaks out of the main loop. Free the structure in this case. Fixes: a3315d1 ("xfs: use rtgroup busy extent list for FITRIM") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 21ab517 commit d8a823c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/xfs/xfs_discard.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,10 @@ xfs_trim_rtgroup_extents(
726726
break;
727727
}
728728

729-
if (!tr.queued)
729+
if (!tr.queued) {
730+
kfree(tr.extents);
730731
break;
732+
}
731733

732734
/*
733735
* We hand the extent list to the discard function here so the

0 commit comments

Comments
 (0)