]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
md: raid10: avoid direct access to bvec table in handle_reshape_read_error
authorMing Lei <tom.leiming@gmail.com>
Thu, 16 Mar 2017 16:12:35 +0000 (00:12 +0800)
committerShaohua Li <shli@fb.com>
Fri, 24 Mar 2017 17:41:37 +0000 (10:41 -0700)
All reshape I/O share pages from 1st copy device, so just use that pages
for avoiding direct access to bvec table in handle_reshape_read_error.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid10.c

index 827bb5bef53c7072cebdae176d9d533e730023cc..0f13d57ef6468aa14b072393945ee18e63fec533 100644 (file)
@@ -4653,7 +4653,10 @@ static int handle_reshape_read_error(struct mddev *mddev,
        struct r10bio *r10b = &on_stack.r10_bio;
        int slot = 0;
        int idx = 0;
-       struct bio_vec *bvec = r10_bio->master_bio->bi_io_vec;
+       struct page **pages;
+
+       /* reshape IOs share pages from .devs[0].bio */
+       pages = get_resync_pages(r10_bio->devs[0].bio)->pages;
 
        r10b->sector = r10_bio->sector;
        __raid10_find_phys(&conf->prev, r10b);
@@ -4682,7 +4685,7 @@ static int handle_reshape_read_error(struct mddev *mddev,
                        success = sync_page_io(rdev,
                                               addr,
                                               s << 9,
-                                              bvec[idx].bv_page,
+                                              pages[idx],
                                               REQ_OP_READ, 0, false);
                        rdev_dec_pending(rdev, mddev);
                        rcu_read_lock();