diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-09-24 02:17:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-05 10:13:09 -0400 |
commit | 9204e9dd40ce207074419e60f66922ce47bb1b79 (patch) | |
tree | eb74a261d8b282a8b71544dc782b8d4c273b0321 | |
parent | 8c15abc94c737f9120d3d4a550abbcbb9be121f6 (diff) |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -917,8 +917,8 @@ void bio_copy_data(struct bio *dst, struct bio *src) | |||
917 | src_p = kmap_atomic(src_bv->bv_page); | 917 | src_p = kmap_atomic(src_bv->bv_page); |
918 | dst_p = kmap_atomic(dst_bv->bv_page); | 918 | dst_p = kmap_atomic(dst_bv->bv_page); |
919 | 919 | ||
920 | memcpy(dst_p + dst_bv->bv_offset, | 920 | memcpy(dst_p + dst_offset, |
921 | src_p + src_bv->bv_offset, | 921 | src_p + src_offset, |
922 | bytes); | 922 | bytes); |
923 | 923 | ||
924 | kunmap_atomic(dst_p); | 924 | kunmap_atomic(dst_p); |