aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2017-03-16 12:12:35 -0400
committerShaohua Li <shli@fb.com>2017-03-24 13:41:37 -0400
commit2d06e3b7145bb08705615e6e7400024d8e36a5c0 (patch)
tree9d1f8a457a580d37b9ba13f02f44ecf9d49d712d
parentcdb76be31568604f389f951bd0efadd3f530f2dd (diff)
md: raid10: avoid direct access to bvec table in handle_reshape_read_error
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>
-rw-r--r--drivers/md/raid10.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 827bb5bef53c..0f13d57ef646 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4653,7 +4653,10 @@ static int handle_reshape_read_error(struct mddev *mddev,
4653 struct r10bio *r10b = &on_stack.r10_bio; 4653 struct r10bio *r10b = &on_stack.r10_bio;
4654 int slot = 0; 4654 int slot = 0;
4655 int idx = 0; 4655 int idx = 0;
4656 struct bio_vec *bvec = r10_bio->master_bio->bi_io_vec; 4656 struct page **pages;
4657
4658 /* reshape IOs share pages from .devs[0].bio */
4659 pages = get_resync_pages(r10_bio->devs[0].bio)->pages;
4657 4660
4658 r10b->sector = r10_bio->sector; 4661 r10b->sector = r10_bio->sector;
4659 __raid10_find_phys(&conf->prev, r10b); 4662 __raid10_find_phys(&conf->prev, r10b);
@@ -4682,7 +4685,7 @@ static int handle_reshape_read_error(struct mddev *mddev,
4682 success = sync_page_io(rdev, 4685 success = sync_page_io(rdev,
4683 addr, 4686 addr,
4684 s << 9, 4687 s << 9,
4685 bvec[idx].bv_page, 4688 pages[idx],
4686 REQ_OP_READ, 0, false); 4689 REQ_OP_READ, 0, false);
4687 rdev_dec_pending(rdev, mddev); 4690 rdev_dec_pending(rdev, mddev);
4688 rcu_read_lock(); 4691 rcu_read_lock();