Check the superblock's free rt extent count against what we observed.
This increases the runtime and memory usage, but we can now report
undercounting frextents as a result of a logging bug in the kernel.
Note that repair has always fixed the undercount, but it no longer does
that silently.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
return -libxfs_trans_commit(tp);
}
+void
+check_rtmetadata(
+ struct xfs_mount *mp)
+{
+ rtinit(mp);
+ generate_rtinfo(mp, btmcompute, sumcompute);
+}
+
void
phase5(xfs_mount_t *mp)
{
if (mp->m_sb.sb_rblocks) {
do_log(
_(" - generate realtime summary info and bitmap...\n"));
- rtinit(mp);
- generate_rtinfo(mp, btmcompute, sumcompute);
+ check_rtmetadata(mp);
}
do_log(_(" - reset superblock...\n"));
void phase2(struct xfs_mount *, int);
void phase3(struct xfs_mount *, int);
void phase4(struct xfs_mount *);
+void check_rtmetadata(struct xfs_mount *mp);
void phase5(struct xfs_mount *);
void phase6(struct xfs_mount *);
void phase7(struct xfs_mount *, int);
sumcompute[offs]++;
}
+ if (mp->m_sb.sb_frextents != sb_frextents) {
+ do_warn(_("sb_frextents %" PRIu64 ", counted %" PRIu64 "\n"),
+ mp->m_sb.sb_frextents, sb_frextents);
+ }
+
return(0);
}
phase4(mp);
phase_end(4);
- if (no_modify)
+ if (no_modify) {
printf(_("No modify flag set, skipping phase 5\n"));
- else {
+
+ if (mp->m_sb.sb_rblocks > 0)
+ check_rtmetadata(mp);
+ } else {
phase5(mp);
}
phase_end(5);