rpms/kernel/F-10 linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch, NONE, 1.1 kernel.spec, 1.1322, 1.1323

Chuck Ebbert cebbert at fedoraproject.org
Mon Apr 13 21:38:20 UTC 2009


Author: cebbert

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

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch 
Log Message:
Fix oops in md raid1 resync (F11#495550)

linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch:

--- NEW FILE linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch ---
From: NeilBrown <neilb at suse.de>
Date: Mon, 6 Apr 2009 04:40:38 +0000 (+1000)
Subject: md/raid1 - don't assume newly allocated bvecs are initialised.
X-Git-Tag: v2.6.30-rc1~176^2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=303a0e11d0ee136ad8f53f747f3c377daece763b

md/raid1 - don't assume newly allocated bvecs are initialised.

Since commit d3f761104b097738932afcc310fbbbbfb007ef92
newly allocated bvecs aren't initialised to NULL, so we have
to be more careful about freeing a bio which only managed
to get a few pages allocated to it.  Otherwise the resync
process crashes.

This patch is appropriate for 2.6.29-stable.

Cc: stable at kernel.org
Cc: "Jens Axboe" <jens.axboe at oracle.com>
Reported-by: Gabriele Tozzi <gabriele at tozzi.eu>
Signed-off-by: NeilBrown <neilb at suse.de>
---

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b4f4bad..f2247b0 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -123,6 +123,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
 				goto out_free_pages;
 
 			bio->bi_io_vec[i].bv_page = page;
+			bio->bi_vcnt = i+1;
 		}
 	}
 	/* If not user-requests, copy the page pointers to all bios */
@@ -138,9 +139,9 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
 	return r1_bio;
 
 out_free_pages:
-	for (i=0; i < RESYNC_PAGES ; i++)
-		for (j=0 ; j < pi->raid_disks; j++)
-			safe_put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
+	for (j=0 ; j < pi->raid_disks; j++)
+		for (i=0; i < r1_bio->bios[j]->bi_vcnt ; i++)
+			put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
 	j = -1;
 out_free_bio:
 	while ( ++j < pi->raid_disks )


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1322
retrieving revision 1.1323
diff -u -r1.1322 -r1.1323
--- kernel.spec	13 Apr 2009 18:21:11 -0000	1.1322
+++ kernel.spec	13 Apr 2009 21:38:18 -0000	1.1323
@@ -690,6 +690,9 @@
 
 Patch3000: linux-2.6-btrfs-experimental-branch.patch
 
+# fix oops in md raid1 (#495550)
+Patch6000: linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch
+
 Patch9000: squashfs3.patch
 Patch9001: squashfs-fixups.patch
 
@@ -899,12 +902,14 @@
 %endif
 
 # more sanity checking; do it quietly
-for patch in %{patches} ; do
-  if [ ! -f $patch ] ; then
-    echo "ERROR: Patch  ${patch##/*/}  listed in specfile but is missing"
-    exit 1
-  fi
-done 2>/dev/null
+if [ "%{patches}" != "%%{patches}" ] ; then
+  for patch in %{patches} ; do
+    if [ ! -f $patch ] ; then
+      echo "ERROR: Patch  ${patch##/*/}  listed in specfile but is missing"
+      exit 1
+    fi
+  done 2>/dev/null
+fi
 
 patch_command='patch -p1 -F1 -s'
 ApplyPatch()
@@ -1274,6 +1279,8 @@
 # silence the ACPI blacklist code
 ApplyPatch linux-2.6-silence-acpi-blacklist.patch
 
+ApplyPatch linux-2.6-md-raid1-dont-assume-new-bvecs-are-init.patch
+
 # we need squashfs3 for Fedora-10
 ApplyPatch squashfs3.patch
 ApplyPatch squashfs-fixups.patch
@@ -1863,6 +1870,9 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Mon Apr 13 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.1-22
+- Fix oops in md raid1 resync (F11#495550)
+
 * Mon Apr 13 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.1-21
 - Copy ALSA pulseaudio fixes from F-11.
 




More information about the scm-commits mailing list