Skip to content

Commit

Permalink
block: Fix bio_copy_data()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kent Overstreet authored and Linus Torvalds committed Sep 24, 2013
1 parent 4a10c2a commit 2f6cf0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2f6cf0d

Please sign in to comment.