mkfs: log stripe unit fails to influence default log size
PATCH 1/1 mkfs: log stripe unit fails to influence default log size
From: Dave Chinner <[email protected]>
This fails:
# mkfs.xfs -f -l version=2,su=256k /dev/ram1 log size 2560 blocks too small, minimum size is 3264 blocks ....
We should be automatically calculating an appropriate, valid log size when the user does not specify it.
--- mkfs/xfs_mkfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
mkfs/xfs_mkfs.c +3 -1
@@ -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); } +/* Log size must exceed the minimum the geometry requires. */ + logblocks =MAX (min_logblocks, logblocks); +/* make sure the log fits wholly within an AG */ if (logblocks >= agsize) logblocks = min_logblocks;
Signature · 6 lines
2.0.0 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 21 lines · Dave Chinner
From: Dave Chinner <[email protected]>
This fails:
# mkfs.xfs -f -l version=2,su=256k /dev/ram1 log size 2560 blocks too small, minimum size is 3264 blocks ....We should be automatically calculating an appropriate, valid log size when the user does not specify it.
Signed-off-by Dave Chinner <[email protected]>--- mkfs/xfs_mkfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)mkfs/xfs_mkfs.c +0
-0
mkfs/xfs_mkfs.c _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), · line 2446
Quoted 7 lines
mkfs/xfs_mkfs.c +1
-1@@ -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); } +/* Log size must exceed the minimum the geometry requires. */
ok, so 4G device with 4k sectors; 4k sectors + log sunit is what made the calculated min_logblocks large enough that it is failing without this change. Those details should probably be in the commit log.
Also, nitpick, it doesn't have to exceed, and MAX() doesn't make it exceed.... maybe:
/* Log size can't be less than the minimum the geometry requires. */
Code wise it's fine, I'd prefer to see commit log & comment tidied up, but:
mkfs/xfs_mkfs.c _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), · line 2451
Quoted 6 lines
mkfs/xfs_mkfs.c +2
-0+ logblocks =MAX (min_logblocks, logblocks); +/* make sure the log fits wholly within an AG */ if (logblocks >= agsize) logblocks = min_logblocks;
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs