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-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>
  0 siblings, 1 reply; 6+ messages in thread
From: Rolf Fokkens @ 2013-09-20  7:06 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: linux-bcache-u79uwXL29TY76Z2rM5mHXA

I'm using bcache on my system for about a week now, and all seems rock 
solid to me. I'm even running my root FS on bcache, which means my 
system might no longer boot when something goes wrong. Based on reported 
issues I also did some stress tests to see if anything breaks, e.g. by 
starting cp's and rsync's and see what happens. I can only tell they 
don't involve much caching, but there's no data corruption.

If I can help by trying to reproduce issues, let me know. I tried, but 
wasn't successful in reproducing issues. So provide any instructions on 
what to reproduce and I'll try to do that. Of course the easiest way to 
reproduce for me would be to do it in a VM, but I'm also OK with using 
my physical "test-configuration".

Rolf

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

* Re: Data corruption with bcache in 3.11
       [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>
  0 siblings, 1 reply; 6+ messages in thread
From: Kent Overstreet @ 2013-09-20  7:44 UTC (permalink / raw)
  To: Rolf Fokkens; +Cc: Kent Overstreet, linux-bcache-u79uwXL29TY76Z2rM5mHXA

If you weren't seeing it before, don't worry about it. Normal setups
with the usual 4k block size won't ever see this.

On Fri, Sep 20, 2013 at 12:06 AM, Rolf Fokkens <rolf-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org> wrote:
> I'm using bcache on my system for about a week now, and all seems rock solid
> to me. I'm even running my root FS on bcache, which means my system might no
> longer boot when something goes wrong. Based on reported issues I also did
> some stress tests to see if anything breaks, e.g. by starting cp's and
> rsync's and see what happens. I can only tell they don't involve much
> caching, but there's no data corruption.
>
> If I can help by trying to reproduce issues, let me know. I tried, but
> wasn't successful in reproducing issues. So provide any instructions on what
> to reproduce and I'll try to do that. Of course the easiest way to reproduce
> for me would be to do it in a VM, but I'm also OK with using my physical
> "test-configuration".
>
> Rolf
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: Data corruption with bcache in 3.11
       [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>
  0 siblings, 1 reply; 6+ messages in thread
From: Rolf Fokkens @ 2013-09-20 19:33 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: Kent Overstreet, linux-bcache-u79uwXL29TY76Z2rM5mHXA

On 09/20/2013 09:44 AM, Kent Overstreet wrote:
> If you weren't seeing it before, don't worry about it. Normal setups
> with the usual 4k block size won't ever see this.
I wouldn't mind helping to reproduce other issues as well, like the 
iozone related issues and the "bcache hangs" issue. I actually tried, 
but bcache worked just fine.

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

* Re: Data corruption with bcache in 3.11
       [not found]           ` <523CA2FF.4090102-6w2rdlBuEQTpMFipWq+H6g@public.gmane.org>
@ 2013-09-20 20:45             ` Zachary Palmer
  0 siblings, 0 replies; 6+ messages in thread
From: Zachary Palmer @ 2013-09-20 20:45 UTC (permalink / raw)
  Cc: Kent Overstreet, linux-bcache-u79uwXL29TY76Z2rM5mHXA

On 09/20/2013 09:44 AM, Kent Overstreet wrote:
> If you weren't seeing it before, don't worry about it. Normal setups
> with the usual 4k block size won't ever see this.
Fascinating.  That might have been my problem; my block size is 
currently 512.  (Is that ill-advised?)  I'm currently running a kernel 
built from the 3.11 corruption fix branch and I have no problems so 
far.  I'll report back in a few days; that's how long it usually took to 
start corrupting things and segfaulting the world. :)

Thanks,

Zach

^ permalink raw reply	[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