summaryrefslogtreecommitdiffstats
path: root/e2fsprogs-1.41.4-i_file_acl_high-fix.patch
blob: f4adb04d419b955f8345810954a8cb99b7a2fb76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
From: Theodore Ts'o <tytso@mit.edu>
Date: Fri, 24 Apr 2009 01:31:16 +0000 (-0400)
Subject: e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero
X-Git-Tag: v1.41.5~3
X-Git-Url: http://git.kernel.org/?p=fs%2Fext2%2Fe2fsprogs.git;a=commitdiff_plain;h=911ec6261568ca56d2d7b9a15f00578c4d127cf4

e2fsck: On a 32-bit filesystem, make sure i_file_acl_high is zero

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

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 04aeb26..3b05cf2 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -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) &&
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 28badc9..b33f596 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -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))) {
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index 8293475..3ff17f0 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -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 */
diff --git a/e2fsck/problem.h b/e2fsck/problem.h
index 1cb054c..ce8de76 100644
--- a/e2fsck/problem.h
+++ b/e2fsck/problem.h
@@ -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
  */