]> git.ipfire.org Git - thirdparty/linux.git/commit
xfs: fix rtgroup cleanup in CoW fork repair
authorYingjie Gao <gaoyingjie@uniontech.com>
Wed, 27 May 2026 04:31:34 +0000 (12:31 +0800)
committerCarlos Maiolino <cem@kernel.org>
Sat, 30 May 2026 06:26:18 +0000 (08:26 +0200)
commitc3e073894379532c00cca7ba5762e18fafe29da8
treef6b29b7990bfac656eb1491f4db988f21ce91a0f
parentfcf4faba9f986b3bb528da11913c9ec5d6e8f689
xfs: fix rtgroup cleanup in CoW fork repair

xrep_cow_find_bad_rt() initializes scrub rtgroup state before the
force-rebuild path calls xrep_cow_mark_file_range(). If that call
fails, the code jumps directly to out_rtg, which skips the scrub
rtgroup cleanup and only drops the local rtgroup reference.

Remove the unnecessary jump so the function falls through to out_sr,
ensuring the realtime cursors, lock state, and sr->rtg reference are
released before returning.

Fixes: fd97fe111208 ("xfs: fix CoW forks for realtime files")
Cc: <stable@vger.kernel.org> # v6.14
Signed-off-by: Yingjie Gao <gaoyingjie@uniontech.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/scrub/cow_repair.c