From: Darrick J. Wong <djwong@xxxxxxxxxx> Now that the minimum default log size is 64MB, we can simplify the ratio computation because the alternate calculations no longer matter: fssize oldlogsize newlogsize 16m 3m 3m 256m 5m 64m 512m 5m 64m 1g 10m 64m 4g 10m 64m 8g 10m 64m 16g 10m 64m 32g 16m 64m 64g 32m 64m 128g 64m 64m 220g 110m 110m 256g 128m 128m 512g 256m 256m 1t 512m 512m 10t 2038m 2038m Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- mkfs/xfs_mkfs.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 239d529c..15dcf48a 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -3432,28 +3432,14 @@ _("external log device size %lld blocks too small, must be at least %lld blocks\ /* internal log - if no size specified, calculate automatically */ if (!cfg->logblocks) { - if (cfg->dblocks < GIGABYTES(1, cfg->blocklog)) { - /* tiny filesystems get minimum sized logs. */ - cfg->logblocks = min_logblocks; - } else if (cfg->dblocks < GIGABYTES(16, cfg->blocklog)) { - - /* - * For small filesystems, we want to use the - * XFS_MIN_LOG_BYTES for filesystems smaller than 16G if - * at all possible, ramping up to 128MB at 256GB. - */ - cfg->logblocks = min(XFS_MIN_LOG_BYTES >> cfg->blocklog, - min_logblocks * XFS_DFL_LOG_FACTOR); - } else { - /* - * With a 2GB max log size, default to maximum size - * at 4TB. This keeps the same ratio from the older - * max log size of 128M at 256GB fs size. IOWs, - * the ratio of fs size to log size is 2048:1. - */ - cfg->logblocks = (cfg->dblocks << cfg->blocklog) / 2048; - cfg->logblocks = cfg->logblocks >> cfg->blocklog; - } + /* + * With a 2GB max log size, default to maximum size at 4TB. + * This keeps the same ratio from the older max log size of + * 128M at 256GB fs size. IOWs, the ratio of fs size to log + * size is 2048:1. + */ + cfg->logblocks = (cfg->dblocks << cfg->blocklog) / 2048; + cfg->logblocks = cfg->logblocks >> cfg->blocklog; calc_realistic_log_size(cfg);