From: Kent Overstreet Date: Tue, 24 Sep 2013 06:17:26 +0000 (-0700) Subject: block: Fix bio_copy_data() X-Git-Tag: v5.15~19261^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2f6cf0de0281d210061ce976f2d42d246adc75bb;p=mirror_ubuntu-kernels.git 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 Cc: Jens Axboe Cc: linux-stable # >= v3.9 Signed-off-by: Linus Torvalds --- 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);