Whamcloud - gitweb
e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero
authorTheodore Ts'o <tytso@mit.edu>
Fri, 24 Apr 2009 01:31:16 +0000 (21:31 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 24 Apr 2009 01:31:16 +0000 (21:31 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c
e2fsck/pass2.c
e2fsck/problem.c
e2fsck/problem.h
tests/f_file_acl_high/expect.1 [new file with mode: 0644]
tests/f_file_acl_high/expect.2 [new file with mode: 0644]
tests/f_file_acl_high/image.gz [new file with mode: 0644]
tests/f_file_acl_high/name [new file with mode: 0644]

index 04aeb26..3b05cf2 100644 (file)
@@ -935,6 +935,10 @@ void e2fsck_pass1(e2fsck_t ctx)
                if (inode->i_faddr || frag || fsize ||
                    (LINUX_S_ISDIR(inode->i_mode) && inode->i_dir_acl))
                        mark_inode_bad(ctx, ino);
+               if (!(fs->super->s_feature_incompat & 
+                     EXT4_FEATURE_INCOMPAT_64BIT) &&
+                   inode->osd2.linux2.l_i_file_acl_high != 0)
+                       mark_inode_bad(ctx, ino);
                if ((fs->super->s_creator_os == EXT2_OS_LINUX) &&
                    !(fs->super->s_feature_ro_compat &
                      EXT4_FEATURE_RO_COMPAT_HUGE_FILE) &&
index 28badc9..b33f596 100644 (file)
@@ -1353,6 +1353,17 @@ extern int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir,
                }
        }
 
+       if (!(fs->super->s_feature_incompat & 
+            EXT4_FEATURE_INCOMPAT_64BIT) &&
+           inode.osd2.linux2.l_i_file_acl_high != 0) {
+               pctx.num = inode.osd2.linux2.l_i_file_acl_high;
+               if (fix_problem(ctx, PR_2_I_FILE_ACL_HI_ZERO, &pctx)) {
+                       inode.osd2.linux2.l_i_file_acl_high = 0;
+                       inode_modified++;
+               } else
+                       not_fixed++;
+       }
+
        if (inode.i_file_acl &&
            ((inode.i_file_acl < fs->super->s_first_data_block) ||
             (inode.i_file_acl >= fs->super->s_blocks_count))) {
index 8293475..3ff17f0 100644 (file)
@@ -1286,6 +1286,11 @@ static struct e2fsck_problem problem_table[] = {
          N_("@E references @i %Di found in @g %g's unused inodes area.\n"),
          PROMPT_FIX, PR_PREEN_OK },
 
+       /* i_blocks_hi should be zero */
+       { PR_2_I_FILE_ACL_HI_ZERO,
+         N_("i_file_acl_hi @F %N, @s zero.\n"),
+         PROMPT_CLEAR, 0 },
+
        /* Pass 3 errors */
 
        /* Pass 3: Checking directory connectivity */
index 1cb054c..ce8de76 100644 (file)
@@ -768,6 +768,9 @@ struct problem_context {
 /* Inode found in group unused inodes area */
 #define PR_2_INOREF_IN_UNUSED          0x020047
 
+/* i_file_acl_hi should be zero */
+#define PR_2_I_FILE_ACL_HI_ZERO                0x020048
+
 /*
  * Pass 3 errors
  */
diff --git a/tests/f_file_acl_high/expect.1 b/tests/f_file_acl_high/expect.1
new file mode 100644 (file)
index 0000000..24d6e06
--- /dev/null
@@ -0,0 +1,12 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+i_file_acl_hi for inode 12 (/motd) is 2, should be zero.
+Clear? yes
+
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 12/16 files (0.0% non-contiguous), 22/100 blocks
+Exit status is 1
diff --git a/tests/f_file_acl_high/expect.2 b/tests/f_file_acl_high/expect.2
new file mode 100644 (file)
index 0000000..4c5476c
--- /dev/null
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 12/16 files (0.0% non-contiguous), 22/100 blocks
+Exit status is 0
diff --git a/tests/f_file_acl_high/image.gz b/tests/f_file_acl_high/image.gz
new file mode 100644 (file)
index 0000000..6342d58
Binary files /dev/null and b/tests/f_file_acl_high/image.gz differ
diff --git a/tests/f_file_acl_high/name b/tests/f_file_acl_high/name
new file mode 100644 (file)
index 0000000..fd54b06
--- /dev/null
@@ -0,0 +1 @@
+i_file_acl_high should be zero