[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4825A0BF-7505-4273-AD04-C3043BDAF414@dilger.ca>
Date: Mon, 14 Jan 2013 10:41:34 -0700
From: Andreas Dilger <adilger@...ger.ca>
To: Zheng Liu <gnehzuil.liu@...il.com>
Cc: linux-ext4@...r.kernel.org, Zheng Liu <wenqing.lz@...bao.com>
Subject: Re: [PATCH 2/3] mke2fs: reduce the range of cluster-size
On 2013-01-13, at 2:08 AM, Zheng Liu wrote:
> Here we reduce the range of cluster-size and check s_blocks_per_group=0 to avoid 'division by zero' error.
>
> Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index bf4d7a2..f4140a1 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -1384,8 +1384,8 @@ profile_error:
> break;
> case 'C':
> cluster_size = strtoul(optarg, &tmp, 0);
> - if (cluster_size < EXT2_MIN_CLUSTER_SIZE ||
> - cluster_size > EXT2_MAX_CLUSTER_SIZE || *tmp) {
> + if (cluster_size <= EXT2_MIN_CLUSTER_SIZE ||
> + cluster_size >= EXT2_MAX_CLUSTER_SIZE || *tmp) {
> com_err(program_name, 0,
> _("invalid cluster size - %s"),
> optarg);
Wouldn't it make more sense to change EXT2_MIN_CLUSTER_SIZE and EXT2_MAX_CLUSTER_SIZE? Otherwise, those constants don't really
contain the min/max cluster size, and it is confusing to use them
in other code.
Cheers, Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists