On Wed, Nov 03, 2021 at 11:10:41PM +0800, Coly Li wrote:
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 93b67b8d31c3..88c573eeb598 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -378,7 +378,7 @@ static void do_btree_node_write(struct btree *b) struct bvec_iter_all iter_all; bio_for_each_segment_all(bv, b->bio, iter_all) {
memcpy(bvec_virt(bv), addr, PAGE_SIZE);
memcpy(page_address(bv->bv_page), addr, PAGE_SIZE);
How could there be an offset? bch_bio_alloc_pages allocates a fresh page for each vec, and bio_for_each_segment_all iterates page by page. IFF there is an offset there is proble in the surrounding code as bch_bio_alloc_pages assumes that it is called on a freshly allocate and initialized bio.