]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
mkfs.xfs fix sunit size on 512e and 4kN disks.
authorLukas Herbolt <lukas@herbolt.com>
Thu, 19 Feb 2026 11:44:09 +0000 (12:44 +0100)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 19 Feb 2026 15:37:13 +0000 (16:37 +0100)
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 <lukas@herbolt.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
mkfs/xfs_mkfs.c

index a11994027c2df1e61eece3bee24285323ad6fc23..a7a6fde93277970134282167387d707e1c9c6d1d 100644 (file)
@@ -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,