From: Dave Chinner Date: Tue, 24 Feb 2015 04:05:25 +0000 (+1100) Subject: mkfs: log stripe unit fails to influence default log size X-Git-Tag: v3.2.3-rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd76b93e4315982575f78f3e68238396ff636dee;p=thirdparty%2Fxfsprogs-dev.git mkfs: log stripe unit fails to influence default log size 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 Reviewed-by: Eric Sandeen Signed-off-by: Dave Chinner --- diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 66711cb8d..484e7a858 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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;