mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
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>
This commit is contained in:
parent
4a10c2ac2f
commit
2f6cf0de02
4
fs/bio.c
4
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);
|
||||
|
Loading…
Reference in New Issue
Block a user