* [PATCH] mkfs: log stripe unit fails to influence default log size
@ 2015-02-24 2:39 Dave Chinner
2015-02-24 3:48 ` Eric Sandeen
0 siblings, 1 reply; 2+ messages in thread
From: Dave Chinner @ 2015-02-24 2:39 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
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 <dchinner@redhat.com>
---
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 66711cb..5e10c4e 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);
}
+ /* 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;
--
2.0.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mkfs: log stripe unit fails to influence default log size
2015-02-24 2:39 [PATCH] mkfs: log stripe unit fails to influence default log size Dave Chinner
@ 2015-02-24 3:48 ` Eric Sandeen
0 siblings, 0 replies; 2+ messages in thread
From: Eric Sandeen @ 2015-02-24 3:48 UTC (permalink / raw)
To: Dave Chinner, xfs
On 2/23/15 8:39 PM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> 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 <dchinner@redhat.com>
> ---
> 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 66711cb..5e10c4e 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);
> }
>
> + /* 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:
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> + logblocks = MAX(min_logblocks, logblocks);
> +
> /* make sure the log fits wholly within an AG */
> if (logblocks >= agsize)
> logblocks = min_logblocks;
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-24 3:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 2:39 [PATCH] mkfs: log stripe unit fails to influence default log size Dave Chinner
2015-02-24 3:48 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox