summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-09-21 14:09:29 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:17:11 -0700
commit2ddb5be2447ed5db8e4ffc0d0482c22dac97c4d2 (patch)
tree251c67e4e1151935a3e21969e98ed4c9b6713814 /fs/xfs/scrub
parent5ba1dc102ab709b1d2a039f05623120fd45d61a5 (diff)
xfs: add block headers to realtime summary blocks
Upgrade rtsummary blocks to have self describing metadata like most every other thing in XFS. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/rtsummary_repair.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/xfs/scrub/rtsummary_repair.c b/fs/xfs/scrub/rtsummary_repair.c
index 713b79a1f52a..0836c1e10504 100644
--- a/fs/xfs/scrub/rtsummary_repair.c
+++ b/fs/xfs/scrub/rtsummary_repair.c
@@ -88,13 +88,24 @@ xrep_rtsummary_prep_buf(
struct xfs_mount *mp = sc->mp;
int error;
- bp->b_ops = &xfs_rtbuf_ops;
-
error = xfsum_copyout(sc, rs->prep_wordoff,
xfs_rsumblock_infoptr(bp, 0), mp->m_blockwsize);
if (error)
return error;
+ if (xfs_has_rtgroups(sc->mp)) {
+ struct xfs_rtbuf_blkinfo *hdr = bp->b_addr;
+
+ hdr->rt_magic = cpu_to_be32(XFS_RTSUMMARY_MAGIC);
+ hdr->rt_owner = cpu_to_be64(sc->ip->i_ino);
+ hdr->rt_blkno = cpu_to_be64(xfs_buf_daddr(bp));
+ hdr->rt_lsn = 0;
+ uuid_copy(&hdr->rt_uuid, &sc->mp->m_sb.sb_meta_uuid);
+ bp->b_ops = &xfs_rtsummary_buf_ops;
+ } else {
+ bp->b_ops = &xfs_rtbuf_ops;
+ }
+
rs->prep_wordoff += mp->m_blockwsize;
xfs_trans_buf_set_type(sc->tp, bp, XFS_BLFT_RTSUMMARY_BUF);
return 0;