xfsprogs/0056-mkfs-Ensure-extsize-aligned-to-stripe-unit-for-force.patch
zhangjian f908c320a1 support atomic write
(cherry picked from commit 40226fa996b6e2d02ded47834cf5289a5f7160e6)
2024-06-19 11:40:47 +08:00

36 lines
1.1 KiB
Diff

From d95dc0f4b90de16168c533e495c5ee1e012e41fd Mon Sep 17 00:00:00 2001
From: John Garry <john.g.garry@oracle.com>
Date: Thu, 21 Mar 2024 12:20:37 +0000
Subject: [PATCH 11/11] mkfs: Ensure extsize aligned to stripe unit for
forcealign
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
mkfs/xfs_mkfs.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 5169255..cf0852f 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2754,6 +2754,16 @@ _("%s: Stripe unit(%d) or stripe width(%d) is not a multiple of the block size(%
cfg->dsunit = DTOBT(dsunit, cfg->blocklog);
cfg->dswidth = DTOBT(dswidth, cfg->blocklog);
+ if (cli->fsx.fsx_xflags & FS_XFLAG_FORCEALIGN) {
+ if ((cfg->dsunit % cli->fsx.fsx_extsize) ||
+ (cfg->dswidth % cli->fsx.fsx_extsize)) {
+ fprintf(stderr,
+ _("Stripe unit(%d) or stripe width(%d) is not a multiple of the extsize (%d) for forcealign\n"),
+ cfg->dsunit, cfg->dswidth, cli->fsx.fsx_extsize);
+ usage();
+ }
+ }
+
check_lsunit:
/* log sunit options */
if (cli_opt_set(&lopts, L_SUNIT))
--
2.33.0