summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-09-23 23:17:26 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 07:13:09 -0700
commit9204e9dd40ce207074419e60f66922ce47bb1b79 (patch)
treeeb74a261d8b282a8b71544dc782b8d4c273b0321
parent8c15abc94c737f9120d3d4a550abbcbb9be121f6 (diff)
downloadlinux-stable-9204e9dd40ce207074419e60f66922ce47bb1b79.tar.gz
linux-stable-9204e9dd40ce207074419e60f66922ce47bb1b79.tar.bz2
linux-stable-9204e9dd40ce207074419e60f66922ce47bb1b79.zip
block: Fix bio_copy_data()
commit 2f6cf0de0281d210061ce976f2d42d246adc75bb upstream. 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@daterainc.com> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/bio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bio.c b/fs/bio.c
index c5eae7251490..5e7507d79297 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);