From 84b8a0d1981f2b90bc916871c32eb0d97595b43c Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 15 Aug 2024 11:56:32 -0700 Subject: [PATCH] mkfs: add headers to realtime bitmap blocks When the rtgroups feature is enabled, format rtbitmap blocks with the appropriate block headers. libxfs takes care of the actual writing for us, so all we have to do is ensure that the bitmap is the correct size. Signed-off-by: Darrick J. Wong --- mkfs/xfs_mkfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 38a51b43f..4ea734a4d 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3210,6 +3210,7 @@ validate_rtdev( struct cli_params *cli) { struct libxfs_init *xi = cli->xi; + unsigned int rbmblocksize = cfg->blocksize; if (!xi->rt.dev) { if (cli->rtsize) { @@ -3253,8 +3254,10 @@ reported by the device (%u).\n"), _("cannot have an rt subvolume with zero extents\n")); usage(); } + if (cfg->sb_feat.metadir) + rbmblocksize -= sizeof(struct xfs_rtbuf_blkinfo); cfg->rtbmblocks = (xfs_extlen_t)howmany(cfg->rtextents, - NBBY * cfg->blocksize); + NBBY * rbmblocksize); } static bool -- 2.50.1