]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: add headers to realtime bitmap blocks
authorDarrick J. Wong <djwong@kernel.org>
Thu, 21 Nov 2024 00:24:41 +0000 (16:24 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 24 Dec 2024 02:01:35 +0000 (18:01 -0800)
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" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
mkfs/xfs_mkfs.c

index 2549a636568d1b1ad344a4838d2637d42e944995..5b9fd0e92f7aba35af4c26ae0b7b1fc811c8dcad 100644 (file)
@@ -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