]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add bio_clone fix for md/dm data loss issue, fwd from akpm.
authorChris Wright <chrisw@osdl.org>
Thu, 28 Jul 2005 18:19:33 +0000 (11:19 -0700)
committerChris Wright <chrisw@osdl.org>
Thu, 28 Jul 2005 18:19:33 +0000 (11:19 -0700)
queue/bio_clone-fix.patch [new file with mode: 0644]
queue/series

diff --git a/queue/bio_clone-fix.patch b/queue/bio_clone-fix.patch
new file mode 100644 (file)
index 0000000..6267a6b
--- /dev/null
@@ -0,0 +1,42 @@
+From stable-bounces@linux.kernel.org  Thu Jul 28 11:03:43 2005
+Date: Thu, 28 Jul 2005 11:02:26 -0700
+From: Andrew Morton <akpm@osdl.org>
+To: stable@kernel.org, linux-kernel@vger.kernel.org
+Cc: 
+Subject: [stable] Fw: [PATCH] bio_clone fix
+
+[PATCH] bio_clone fix
+
+Fix bug introduced in 2.6.11-rc2: when we clone a BIO we need to copy over the
+current index into it as well.
+
+It corrupts data with some MD setups.
+
+See http://bugzilla.kernel.org/show_bug.cgi?id=4946
+
+Huuuuuuuuge thanks to Matthew Stapleton <matthew4196@gmail.com> for doggedly
+chasing this one down.
+
+Acked-by: Jens Axboe <axboe@suse.de>
+Cc: <linux-raid@vger.kernel.org>
+Cc: <dm-devel@redhat.com>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ fs/bio.c |    1 +
+ 1 files changed, 1 insertion(+)
+
+diff --git a/fs/bio.c b/fs/bio.c
+--- a/fs/bio.c
++++ b/fs/bio.c
+@@ -261,6 +261,7 @@ inline void __bio_clone(struct bio *bio,
+        */
+       bio->bi_vcnt = bio_src->bi_vcnt;
+       bio->bi_size = bio_src->bi_size;
++      bio->bi_idx = bio_src->bi_idx;
+       bio_phys_segments(q, bio);
+       bio_hw_segments(q, bio);
+ }
+-
index 3a640fbaf2256c00e26b30eedd6a2c71b48e2c62..f468ea1d11df38462e3b6674e8f7c587f2e541d3 100644 (file)
@@ -7,3 +7,4 @@ netfilter-deadlock-ip6_queue.patch
 netfilter-NAT-memory-corruption.patch
 netfilter-ip_conntrack_untracked-refcount.patch
 ipsec-array-overflow.patch
+bio_clone-fix.patch