Whamcloud - gitweb
e2fsck: enable extents on all 64bit filesystems
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 12 Oct 2013 01:20:36 +0000 (21:20 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 12 Oct 2013 01:20:36 +0000 (21:20 -0400)
Since it's impossible to address all blocks of a 64bit filesystem
without extents, have e2fsck turn on the feature if it finds (64bit &&
!extents).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/problem.c
e2fsck/problem.h
e2fsck/super.c

index 6d03765..66e2e05 100644 (file)
@@ -433,6 +433,11 @@ static struct e2fsck_problem problem_table[] = {
          N_("ext2fs_check_desc: %m\n"),
          PROMPT_NONE, 0 },
 
+       /* 64bit is set but extents is unset. */
+       { PR_0_64BIT_WITHOUT_EXTENTS,
+         N_("@S 64bit filesystems needs extents to access the whole disk.  "),
+         PROMPT_FIX, PR_PREEN_OK | PR_NO_OK},
+
        /* Pass 1 errors */
 
        /* Pass 1: Checking inodes, blocks, and sizes */
index b578678..4e7c9cd 100644 (file)
@@ -249,6 +249,9 @@ struct problem_context {
 /* Checking group descriptor failed */
 #define PR_0_CHECK_DESC_FAILED                 0x000045
 
+/* 64bit is set but extents are not set. */
+#define PR_0_64BIT_WITHOUT_EXTENTS             0x000048
+
 /*
  * Pass 1 errors
  */
index 07f5fe5..352f16d 100644 (file)
@@ -582,6 +582,17 @@ void check_super_block(e2fsck_t ctx)
                }
        }
 
+       /* Is 64bit set and extents unset? */
+       if (EXT2_HAS_INCOMPAT_FEATURE(fs->super,
+                                     EXT4_FEATURE_INCOMPAT_64BIT) &&
+           !EXT2_HAS_INCOMPAT_FEATURE(fs->super,
+                                      EXT3_FEATURE_INCOMPAT_EXTENTS) &&
+           fix_problem(ctx, PR_0_64BIT_WITHOUT_EXTENTS, &pctx)) {
+               fs->super->s_feature_incompat |=
+                       EXT3_FEATURE_INCOMPAT_EXTENTS;
+               ext2fs_mark_super_dirty(fs);
+       }
+
        /*
         * Verify the group descriptors....
         */