public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
* Data corruption with bcache in 3.11
@ 2013-09-20  2:35 Kent Overstreet
  2013-09-20  7:06 ` Rolf Fokkens
  0 siblings, 1 reply; 6+ messages in thread
From: Kent Overstreet @ 2013-09-20  2:35 UTC (permalink / raw)
  To: linux-bcache-u79uwXL29TY76Z2rM5mHXA

If you were one of the users seeing data corruption in 3.11 but not any
of the 3.10 stable kernel, I think I just fixed it. It's now clearer why
it was only hitting some users, too...

I want to get confirmation from someone who was seeing it that it fixes
the issue, so please test the fix and let me know what happens. It's in
my bcache-data-corruption-fix branch, and the patch is below:

commit 97ad43a31a7ea3c23a4eb64b8e26aad3cf21ae8d
Author: Kent Overstreet <kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org>
Date:   Thu Sep 19 19:10:24 2013 -0700

    block: Fix bio_copy_data()
    
    The memcpy() in bio_copy_data() was using the wrong offset vars, leading
    to data corruption in weird unusual setups.
    
    Signed-off-by: Kent Overstreet <kmo-PEzghdH756F8UrSeD/g0lQ@public.gmane.org>
    Cc: linux-stable <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # >= v3.9

diff --git a/fs/bio.c b/fs/bio.c
index c5eae72..5e7507d 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -917,8 +917,8 @@ void bio_copy_data(struct bio *dst, struct bio *src)
 		src_p = kmap_atomic(src_bv->bv_page);
 		dst_p = kmap_atomic(dst_bv->bv_page);
 
-		memcpy(dst_p + dst_bv->bv_offset,
-		       src_p + src_bv->bv_offset,
+		memcpy(dst_p + dst_offset,
+		       src_p + src_offset,
 		       bytes);
 
 		kunmap_atomic(dst_p);

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* Re: Data corruption with bcache in 3.11
@ 2013-09-29 16:52 Joseph Yasi
  0 siblings, 0 replies; 6+ messages in thread
From: Joseph Yasi @ 2013-09-29 16:52 UTC (permalink / raw)
  To: linux-bcache-u79uwXL29TY76Z2rM5mHXA

On 09/20/2013 02:35 AM, Kent Overstreet wrote:
> If you were one of the users seeing data corruption in 3.11 but not any
> of the 3.10 stable kernel, I think I just fixed it. It's now clearer why
> it was only hitting some users, too...
>
> I want to get confirmation from someone who was seeing it that it fixes
> the issue, so please test the fix and let me know what happens. It's in
> my bcache-data-corruption-fix branch, and the patch is below:
>
> commit 97ad43a31a7ea3c23a4eb64b8e26aad3cf21ae8d

This patch seems to fix the corruption problem for me caching an md
RAID10 array.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-29 16:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20  2:35 Data corruption with bcache in 3.11 Kent Overstreet
2013-09-20  7:06 ` Rolf Fokkens
     [not found]   ` <523BF3EB.7050709-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org>
2013-09-20  7:44     ` Kent Overstreet
     [not found]       ` <CALJ65zkj2U-Kr_EBx7RJETqW2jQmWxsr0QmZspHU3H+jDts3tQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-20 19:33         ` Rolf Fokkens
     [not found]           ` <523CA2FF.4090102-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org>
2013-09-20 20:45             ` Zachary Palmer
  -- strict thread matches above, loose matches on Subject: below --
2013-09-29 16:52 Joseph Yasi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox