mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
xfs: fix rtgroup cleanup in CoW fork repair
commitc3e0738943upstream. 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:fd97fe1112("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d84ed2f971
commit
fcfdff42e8
@@ -382,12 +382,9 @@ xrep_cow_find_bad_rt(
|
||||
* CoW fork and then scan for staging extents in the refcountbt.
|
||||
*/
|
||||
if ((sc->sm->sm_flags & XFS_SCRUB_IFLAG_FORCE_REBUILD) ||
|
||||
XFS_TEST_ERROR(sc->mp, XFS_ERRTAG_FORCE_SCRUB_REPAIR)) {
|
||||
XFS_TEST_ERROR(sc->mp, XFS_ERRTAG_FORCE_SCRUB_REPAIR))
|
||||
error = xrep_cow_mark_file_range(xc, xc->irec.br_startblock,
|
||||
xc->irec.br_blockcount);
|
||||
if (error)
|
||||
goto out_rtg;
|
||||
}
|
||||
|
||||
out_sr:
|
||||
xchk_rtgroup_btcur_free(&sc->sr);
|
||||
|
||||
Reference in New Issue
Block a user