summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-09-23 23:17:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-24 14:41:42 -0700
commit2f6cf0de0281d210061ce976f2d42d246adc75bb (patch)
treeae0e24e3410750aa0a44061cc5a0ced9c3128670 /fs
parent4a10c2ac2f368583138b774ca41fac4207911983 (diff)
downloadlinux-2f6cf0de0281d210061ce976f2d42d246adc75bb.tar.bz2
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@daterainc.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: linux-stable <stable@vger.kernel.org> # >= v3.9 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/bio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bio.c b/fs/bio.c
index b3b20ed9510e..ea5035da4d9a 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);