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 <[email protected]>
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 <[email protected]>
    Cc: linux-stable <[email protected]> # >= 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to