]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: If a superblock is specified explicitly by the
authorTheodore Ts'o <tytso@mit.edu>
Wed, 19 Sep 2001 19:17:25 +0000 (15:17 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 19 Sep 2001 19:17:25 +0000 (15:17 -0400)
user, don't try to automatically fall back to an
alternate superblock.

e2fsck/ChangeLog
e2fsck/e2fsck.h
e2fsck/unix.c

index 1c7159b9489933ddfd4c29c0c3deeead917f364b..7787e11c3bcfbcfeb6fe9ad45057e263dc44693b 100644 (file)
@@ -1,3 +1,9 @@
+2001-09-19  Theodore Tso  <tytso@valinux.com>
+
+       * unix.c (main): If a superblock is specified explicitly by the
+               user, don't try to automatically fall back to an
+               alternate superblock.
+
 2001-09-02  Theodore Tso  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.24a
index fe2537ca65634cc9708db1465bb8aa7fad7264aa..0541ab1f468db700c2c08733a999f0531f499595 100644 (file)
@@ -115,6 +115,8 @@ struct resource_track {
 #define E2F_FLAG_PROG_BAR      0x0020 /* Progress bar on screen */
 #define E2F_FLAG_PROG_SUPPRESS 0x0040 /* Progress suspended */
 #define E2F_FLAG_JOURNAL_INODE 0x0080 /* Create a new ext3 journal inode */
+#define E2F_FLAG_SB_SPECIFIED  0x0100 /* The superblock was explicitly 
+                                       * specified by the user */
 
 /*
  * Defines for indicating the e2fsck pass number
index c15b1d35fb7000a9fce2e9f71fae5fd88dd05914..fb48f2bde48efc9048dd3c6b537f2169ab9a5692 100644 (file)
@@ -520,6 +520,7 @@ static errcode_t PRS(int argc, char *argv[], e2fsck_t *ret_ctx)
                        break;
                case 'b':
                        ctx->use_superblock = atoi(optarg);
+                       ctx->flags |= E2F_FLAG_SB_SPECIFIED;
                        break;
                case 'B':
                        blocksize = atoi(optarg);
@@ -746,7 +747,8 @@ restart:
        } else 
                retval = ext2fs_open(ctx->filesystem_name, flags, 
                                     0, 0, io_ptr, &fs);
-       if (!ctx->superblock && !(ctx->options & E2F_OPT_PREEN) && 
+       if (!ctx->superblock && !(ctx->options & E2F_OPT_PREEN) &&
+           !(ctx->flags & E2F_FLAG_SB_SPECIFIED) &&
            ((retval == EXT2_ET_BAD_MAGIC) ||
             ((retval == 0) && ext2fs_check_desc(fs)))) {
                if (!fs || (fs->group_desc_count > 1)) {