From: Lukas Herbolt Date: Thu, 19 Feb 2026 11:44:09 +0000 (+0100) Subject: mkfs.xfs fix sunit size on 512e and 4kN disks. X-Git-Tag: v6.19.0~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca1eb448e116dab7fd773adb89d9121ee4242ea0;p=xfsprogs-dev.git mkfs.xfs fix sunit size on 512e and 4kN disks. Creating of XFS on 4kN or 512e disk result in suboptimal LSU/LSUNIT. As of now we check if the sectorsize is bigger than XLOG_HEADER_SIZE and so we set lsu to blocksize. But we do not check the the size if lsunit can be bigger to fit the disk geometry. Signed-off-by: Lukas Herbolt Reviewed-by: Christoph Hellwig --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index a1199402..a7a6fde9 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3627,7 +3627,7 @@ check_lsunit: else if (cfg->lsectorsize > XLOG_HEADER_SIZE) lsu = cfg->blocksize; /* lsunit matches filesystem block size */ - if (lsu) { + if (cli->lsu) { /* verify if lsu is a multiple block size */ if (lsu % cfg->blocksize != 0) { fprintf(stderr,