OSDN Git Service

mke2fs: allow setting the stride and stripe width to zero
authorTheodore Ts'o <tytso@mit.edu>
Tue, 5 Jul 2011 00:22:19 +0000 (20:22 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 5 Jul 2011 00:43:39 +0000 (20:43 -0400)
Mke2fs previously would give an error if the user tried setting the
stride and stripe-width parameters to zero; but this is necessary to
override the stride and stripe-width settings which get automatically
set from the block device's geometry information in sysfs.  So allow
setting these parameters to zero.

Addresses-Google-Bug: #4988555

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/mke2fs.c

index e28828e..93ae4bc 100644 (file)
@@ -731,7 +731,7 @@ static void parse_extended_opts(struct ext2_super_block *param,
                                continue;
                        }
                        param->s_raid_stride = strtoul(arg, &p, 0);
-                       if (*p || (param->s_raid_stride == 0)) {
+                       if (*p) {
                                fprintf(stderr,
                                        _("Invalid stride parameter: %s\n"),
                                        arg);
@@ -746,7 +746,7 @@ static void parse_extended_opts(struct ext2_super_block *param,
                                continue;
                        }
                        param->s_raid_stripe_width = strtoul(arg, &p, 0);
-                       if (*p || (param->s_raid_stripe_width == 0)) {
+                       if (*p) {
                                fprintf(stderr,
                                        _("Invalid stripe-width parameter: %s\n"),
                                        arg);