]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
mkfs: log stripe unit fails to influence default log size
authorDave Chinner <dchinner@redhat.com>
Tue, 24 Feb 2015 04:05:25 +0000 (15:05 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 24 Feb 2015 04:05:25 +0000 (15:05 +1100)
This fails on a 4GB, 4k physical sector size device:

# mkfs.xfs -f -l version=2,su=256k /dev/ram1
log size 2560 blocks too small, minimum size is 3264 blocks
....

The combination of 4k sectors and a log stripe unit increase the
minimum size of the log.  We should be automatically calculating an
appropriate, valid log size when the user does not specify it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
mkfs/xfs_mkfs.c

index 66711cb8d2444c129ae18818fe13bea189c34520..484e7a858431f3dd10d7558c2ddc72fd6857164e 100644 (file)
@@ -2441,9 +2441,11 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
                         */
                        logblocks = (dblocks << blocklog) / 2048;
                        logblocks = logblocks >> blocklog;
-                       logblocks = MAX(min_logblocks, logblocks);
                }
 
+               /* Ensure the chosen size meets minimum log size requirements */
+               logblocks = MAX(min_logblocks, logblocks);
+
                /* make sure the log fits wholly within an AG */
                if (logblocks >= agsize)
                        logblocks = min_logblocks;