From bd76b93e4315982575f78f3e68238396ff636dee Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Tue, 24 Feb 2015 15:05:25 +1100 Subject: [PATCH] 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 --- mkfs/xfs_mkfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.50.1