rpms/kernel/F-10 linux-2.6.27-ext4-fix-header-check.patch, NONE, 1.1.2.1 linux-2.6.27-ext4-print-warning-once.patch, NONE, 1.1.2.1 kernel.spec, 1.1206.2.46, 1.1206.2.47

Chuck Ebbert cebbert at fedoraproject.org
Sat Mar 14 01:40:13 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7344

Modified Files:
      Tag: private-fedora-10-2_6_27
	kernel.spec 
Added Files:
      Tag: private-fedora-10-2_6_27
	linux-2.6.27-ext4-fix-header-check.patch 
	linux-2.6.27-ext4-print-warning-once.patch 
Log Message:
ext4 patches from rawhide:
    Kill off distracting warning messages.
    Fix checking of on-disk extent headers.

linux-2.6.27-ext4-fix-header-check.patch:

--- NEW FILE linux-2.6.27-ext4-fix-header-check.patch ---
From: Eric Sandeen <sandeen at redhat.com>
Date: Tue, 10 Mar 2009 22:18:47 +0000 (-0400)
Subject: ext4: fix header check in ext4_ext_search_right() for deep extent trees.
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftytso%2Fext4.git;a=commitdiff_plain;h=402af9e0b37a46e1dfb552e761b76c84df089c5a

ext4: fix header check in ext4_ext_search_right() for deep extent trees.

The ext4_ext_search_right() function is confusing; it uses a
"depth" variable which is 0 at the root and maximum at the leaves,
but the on-disk metadata uses a "depth" (actually eh_depth) which
is opposite: maximum at the root, and 0 at the leaves.

The ext4_ext_check_header() function is given a depth and checks
the header agaisnt that depth; it expects the on-disk semantics,
but we are giving it the opposite in the while loop in this
function.  We should be giving it the on-disk notion of "depth"
which we can get from (p_depth - depth) - and if you look, the last
(more commonly hit) call to ext4_ext_check_header() does just this.

Sending in the wrong depth results in (incorrect) messages
about corruption:

EXT4-fs error (device sdb1): ext4_ext_search_right: bad header
in inode #2621457: unexpected eh_depth - magic f30a, entries 340,
max 340(0), depth 1(2)

http://bugzilla.kernel.org/show_bug.cgi?id=12821

Reported-by: David Dindorp <ddi at dubex.dk>
Signed-off-by: Eric Sandeen <sandeen at redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso at mit.edu>
---

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e2eab19..e0aa4fe 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1122,7 +1122,8 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
 	struct ext4_extent_idx *ix;
 	struct ext4_extent *ex;
 	ext4_fsblk_t block;
-	int depth, ee_len;
+	int depth;	/* Note, NOT eh_depth; depth from top of tree */
+	int ee_len;
 
 	BUG_ON(path == NULL);
 	depth = path->p_depth;
@@ -1179,7 +1180,8 @@ got_index:
 		if (bh == NULL)
 			return -EIO;
 		eh = ext_block_hdr(bh);
-		if (ext4_ext_check_header(inode, eh, depth)) {
+		/* subtract from p_depth to get proper eh_depth */
+		if (ext4_ext_check_header(inode, eh, path->p_depth - depth)) {
 			put_bh(bh);
 			return -EIO;
 		}

linux-2.6.27-ext4-print-warning-once.patch:

--- NEW FILE linux-2.6.27-ext4-print-warning-once.patch ---
From: Theodore Ts'o <tytso at mit.edu>
Date: Thu, 12 Mar 2009 16:20:01 +0000 (-0400)
Subject: ext4: Print the find_group_flex() warning only once
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftytso%2Fext4.git;a=commitdiff_plain;h=e8eb6f8319eb2536d292fc18fe14e745c970049a

ext4: Print the find_group_flex() warning only once

This is a short-term warning, and even printk_ratelimit() can result
in too much noise in system logs.  So only print it once as a warning.

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

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 627f8c3..2d2b358 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -698,6 +698,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
 	struct inode *ret;
 	ext4_group_t i;
 	int free = 0;
+	static int once = 1;
 	ext4_group_t flex_group;
 
 	/* Cannot create files in a deleted directory */
@@ -719,7 +720,8 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
 		ret2 = find_group_flex(sb, dir, &group);
 		if (ret2 == -1) {
 			ret2 = find_group_other(sb, dir, &group);
-			if (ret2 == 0 && printk_ratelimit())
+			if (ret2 == 0 && once)
+				once = 0;
 				printk(KERN_NOTICE "ext4: find_group_flex "
 				       "failed, fallback succeeded dir %lu\n",
 				       dir->i_ino);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1206.2.46
retrieving revision 1.1206.2.47
diff -u -r1.1206.2.46 -r1.1206.2.47
--- kernel.spec	14 Mar 2009 01:10:44 -0000	1.1206.2.46
+++ kernel.spec	14 Mar 2009 01:39:42 -0000	1.1206.2.47
@@ -746,6 +746,10 @@
 Patch2900: linux-2.6.27-ext4-rename-ext4dev-to-ext4.patch
 # Delay capable check to avoid most AVCs (#478299)
 Patch2901: linux-2.6.27.9-ext4-cap-check-delay.patch
+# don't spew warnings when using fallback allocator
+Patch2902: linux-2.6.27-ext4-print-warning-once.patch
+# fix extent header checking
+Patch2903: linux-2.6.27-ext4-fix-header-check.patch
 
 # next round of ext4 patches for -stable
 
@@ -1170,7 +1174,8 @@
 # ext4
 ApplyPatch linux-2.6.27-ext4-rename-ext4dev-to-ext4.patch
 ApplyPatch linux-2.6.27.9-ext4-cap-check-delay.patch
-
+ApplyPatch linux-2.6.27-ext4-print-warning-once.patch
+ApplyPatch linux-2.6.27-ext4-fix-header-check.patch
 
 # xfs
 
@@ -1949,6 +1954,11 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Fri Mar 13 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.27.20-170.2.47.rc1
+- ext4 patches from rawhide:
+    Kill off distracting warning messages.
+    Fix checking of on-disk extent headers.
+
 * Fri Mar 13 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.27.20-170.2.46.rc1
 - 2.6.27.20-rc1
 - Dropped patches, merged in -stable:




More information about the fedora-extras-commits mailing list