Re: [RFC][PATCH 1/11][take 2] add new mkfs option to create ext4 filesystems

Andreas Dilger
2007-06-21T19:08:07Z

On Jun 21, 2007 17:04 +0200, Valerie Clement wrote:
> @@ -1094,6 +1095,14 @@ static void PRS(int argc, char *argv[])
> exit(1);
> }
> break;
> + case 'D':
> + desc_size = strtoul(optarg, &tmp, 0);
> + if (*tmp) {
> + com_err(program_name, 0,
> + _("invalid descriptor size - %s"), optarg);
> + exit(1);
> + }

I think we should limit the descriptor size to a power-of-two value so that
we can access it with only shift operations instead of division, and we do
not need to worry about descriptors crossing blocks.

Also, the upper limit should be the filesystem blocksize.

> @@ -1422,6 +1431,11 @@ static void PRS(int argc, char *argv[])
> + if (desc_size >= EXT2_MIN_DESC_SIZE_64BIT) {
> + fs_param.s_feature_incompat |= EXT4_FEATURE_INCOMPAT_64BIT;
> + fs_param.s_desc_size = EXT2_MIN_DESC_SIZE_64BIT;
> + }

This should be "if (desc_size > EXT2_MIN_DESC_SIZE)" I think, even though
the two are (currently) equivalent.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.