Commit 1fdd6fc9 authored by NeilBrown's avatar NeilBrown

md: teach sync_page_io about new_data_offset.

Some code in raid1 and raid10 use sync_page_io to
read/write pages when responding to read errors.
As we will shortly support changing data_offset for
raid10, this function must understand new_data_offset.

So add that understanding.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 5cf00fcd
...@@ -888,6 +888,10 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, ...@@ -888,6 +888,10 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
rdev->meta_bdev : rdev->bdev; rdev->meta_bdev : rdev->bdev;
if (metadata_op) if (metadata_op)
bio->bi_sector = sector + rdev->sb_start; bio->bi_sector = sector + rdev->sb_start;
else if (rdev->mddev->reshape_position != MaxSector &&
(rdev->mddev->reshape_backwards ==
(sector >= rdev->mddev->reshape_position)))
bio->bi_sector = sector + rdev->new_data_offset;
else else
bio->bi_sector = sector + rdev->data_offset; bio->bi_sector = sector + rdev->data_offset;
bio_add_page(bio, page, size, 0); bio_add_page(bio, page, size, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment