block: take destination bvec offsets into account in bio_copy_data_iter
authorChristoph Hellwig <hch@lst.de>
Tue, 24 May 2022 14:39:19 +0000 (16:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:11 +0000 (18:36 +0200)
commit33a5c6009ab84b66c1839762b78bef89f2d7ad06
tree2761d4f7d07f0f6b919ec8b9feb51b8be9ebbbfd
parentf95e24bf19e2733fa5d5b93cb6d06fd10ff5498b
block: take destination bvec offsets into account in bio_copy_data_iter

[ Upstream commit 403d50341cce6b5481a92eb481e6df60b1f49b55 ]

Appartly bcache can copy into bios that do not just contain fresh
pages but can have offsets into the bio_vecs.  Restore support for tht
in bio_copy_data_iter.

Fixes: f8b679a070c5 ("block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220524143919.1155501-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/bio.c