Skip to content

Commit 2d06e3b

Browse files
ming1shligit
authored andcommitted
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>
1 parent cdb76be commit 2d06e3b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/md/raid10.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4653,7 +4653,10 @@ static int handle_reshape_read_error(struct mddev *mddev,
46534653
struct r10bio *r10b = &on_stack.r10_bio;
46544654
int slot = 0;
46554655
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;
46574660

46584661
r10b->sector = r10_bio->sector;
46594662
__raid10_find_phys(&conf->prev, r10b);
@@ -4682,7 +4685,7 @@ static int handle_reshape_read_error(struct mddev *mddev,
46824685
success = sync_page_io(rdev,
46834686
addr,
46844687
s << 9,
4685-
bvec[idx].bv_page,
4688+
pages[idx],
46864689
REQ_OP_READ, 0, false);
46874690
rdev_dec_pending(rdev, mddev);
46884691
rcu_read_lock();

0 commit comments

Comments
 (0)