Whamcloud - gitweb
tune2fs: allow setting the stride and stripe width to zero
authorTheodore Ts'o <tytso@mit.edu>
Mon, 4 Jul 2011 23:37:11 +0000 (19:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 4 Jul 2011 23:37:11 +0000 (19:37 -0400)
Tune2fs previously would give an error if the user tried setting the
stride and stripe-width parameters to zero; but this is necessary to
disable the stride and stripe-width settings.  So allow setting these
superblock fields to zero.

Addresses-Google-Bug: #4988557

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

index 7d5c092..7aacff3 100644 (file)
@@ -937,7 +937,7 @@ static void parse_extended_opts(ext2_filsys fs, const char *opts)
                                continue;
                        }
                        stride = strtoul(arg, &p, 0);
-                       if (*p || (stride == 0)) {
+                       if (*p) {
                                fprintf(stderr,
                                       _("Invalid RAID stride: %s\n"),
                                        arg);
@@ -952,7 +952,7 @@ static void parse_extended_opts(ext2_filsys fs, const char *opts)
                                continue;
                        }
                        stripe_width = strtoul(arg, &p, 0);
-                       if (*p || (stripe_width == 0)) {
+                       if (*p) {
                                fprintf(stderr,
                                        _("Invalid RAID stripe-width: %s\n"),
                                        arg);