mkfs: autodetect log stripe unit for external log devices
If we're using an external log device and the caller doesn't give us a
lsunit, use the block device geometry (if present) to set it.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 8b946f3..6c8cc71 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -3624,6 +3624,10 @@
cfg->loginternal && cfg->dsunit) {
/* lsunit and dsunit now in fs blocks */
cfg->lsunit = cfg->dsunit;
+ } else if (cfg->sb_feat.log_version == 2 &&
+ !cfg->loginternal) {
+ /* use the external log device properties */
+ cfg->lsunit = DTOBT(ft->log.sunit, cfg->blocklog);
}
if (cfg->sb_feat.log_version == 2 &&