From: Christoph Hellwig Date: Thu, 11 Jul 2024 12:15:12 +0000 (+0200) Subject: repair: always call into phase5() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fxfs-per-rtg-inodes;p=users%2Fhch%2Fxfsprogs.git repair: always call into phase5() Make the phase5() function handle the rt file checking for the no-modify case instead of special casing it in the main repair flow. Signed-off-by: Christoph Hellwig --- diff --git a/repair/phase5.c b/repair/phase5.c index 79499754e..65bdf942d 100644 --- a/repair/phase5.c +++ b/repair/phase5.c @@ -751,6 +751,14 @@ phase5(xfs_mount_t *mp) xfs_agnumber_t agno; int error; + if (no_modify) { + printf(_("No modify flag set, skipping phase 5\n")); + + if (mp->m_sb.sb_rblocks > 0) + check_rtmetadata(mp); + return; + } + do_log(_("Phase 5 - rebuild AG headers and trees...\n")); set_progress_msg(PROG_FMT_REBUILD_AG, (uint64_t)glob_agcount); diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 589090b57..7a231597b 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -1461,14 +1461,7 @@ main(int argc, char **argv) phase4(mp); phase_end(mp, 4); - if (no_modify) { - printf(_("No modify flag set, skipping phase 5\n")); - - if (mp->m_sb.sb_rblocks > 0) - check_rtmetadata(mp); - } else { - phase5(mp); - } + phase5(mp); phase_end(mp, 5); rcbagbt_destroy_cur_cache();