diff options
author | NeilBrown <neilb@suse.de> | 2012-05-20 19:27:00 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-20 19:27:00 -0400 |
commit | c6563a8c38fde3c1c7fc925a10bde3ca20799301 (patch) | |
tree | 3916ae8247149a9dcf39ee1ca262f97be39071eb /drivers/md/raid1.c | |
parent | 2c810cddc44d6f95cef75df3f07fc0850ff92417 (diff) |
md: add possibility to change data-offset for devices.
When reshaping we can avoid costly intermediate backup by
changing the 'start' address of the array on the device
(if there is enough room).
So as a first step, allow such a change to be requested
through sysfs, and recorded in v1.x metadata.
(As we didn't previous check that all 'pad' fields were zero,
we need a new FEATURE flag for this.
A (belatedly) check that all remaining 'pad' fields are
zero to avoid a repeat of this)
The new data offset must be requested separately for each device.
This allows each to have a different change in the data offset.
This is not likely to be used often but as data_offset can be
set per-device, new_data_offset should be too.
This patch also removes the 'acknowledged' arg to rdev_set_badblocks as
it is never used and never will be. At the same time we add a new
arg ('in_new') which is currently always zero but will be used more
soon.
When a reshape finishes we will need to update the data_offset
and rdev->sectors. So provide an exported function to do that.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 15dd59b84e94..71a7dc038a82 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -2024,7 +2024,7 @@ static void handle_sync_write_finished(struct r1conf *conf, struct r1bio *r1_bio | |||
2024 | continue; | 2024 | continue; |
2025 | if (test_bit(BIO_UPTODATE, &bio->bi_flags) && | 2025 | if (test_bit(BIO_UPTODATE, &bio->bi_flags) && |
2026 | test_bit(R1BIO_MadeGood, &r1_bio->state)) { | 2026 | test_bit(R1BIO_MadeGood, &r1_bio->state)) { |
2027 | rdev_clear_badblocks(rdev, r1_bio->sector, s); | 2027 | rdev_clear_badblocks(rdev, r1_bio->sector, s, 0); |
2028 | } | 2028 | } |
2029 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags) && | 2029 | if (!test_bit(BIO_UPTODATE, &bio->bi_flags) && |
2030 | test_bit(R1BIO_WriteError, &r1_bio->state)) { | 2030 | test_bit(R1BIO_WriteError, &r1_bio->state)) { |
@@ -2044,7 +2044,7 @@ static void handle_write_finished(struct r1conf *conf, struct r1bio *r1_bio) | |||
2044 | struct md_rdev *rdev = conf->mirrors[m].rdev; | 2044 | struct md_rdev *rdev = conf->mirrors[m].rdev; |
2045 | rdev_clear_badblocks(rdev, | 2045 | rdev_clear_badblocks(rdev, |
2046 | r1_bio->sector, | 2046 | r1_bio->sector, |
2047 | r1_bio->sectors); | 2047 | r1_bio->sectors, 0); |
2048 | rdev_dec_pending(rdev, conf->mddev); | 2048 | rdev_dec_pending(rdev, conf->mddev); |
2049 | } else if (r1_bio->bios[m] != NULL) { | 2049 | } else if (r1_bio->bios[m] != NULL) { |
2050 | /* This drive got a write error. We need to | 2050 | /* This drive got a write error. We need to |