diff options
author | Shaohua Li <shli@fb.com> | 2016-12-08 15:48:17 -0800 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-12-08 22:00:11 -0800 |
commit | 6995f0b247e15e34fbcd10852c08b30bdc1a78da (patch) | |
tree | cf269278686e1ace761edded6fe4e7ae64417920 /drivers/md/raid0.c | |
parent | 3c6edc66085e1d895a698c572bbfaf4d57fdb771 (diff) |
md: takeover should clear unrelated bits
When we change level from raid1 to raid5, the MD_FAILFAST_SUPPORTED bit
will be accidentally set, but raid5 doesn't support it. The same is true
for the MD_HAS_JOURNAL bit.
Fix: 46533ff (md: Use REQ_FAILFAST_* on metadata writes where appropriate)
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e628f187e5ad..a162fedeb51a 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -539,8 +539,11 @@ static void *raid0_takeover_raid45(struct mddev *mddev) mddev->delta_disks = -1; /* make sure it will be not marked as dirty */ mddev->recovery_cp = MaxSector; + clear_bit(MD_HAS_JOURNAL, &mddev->flags); + clear_bit(MD_JOURNAL_CLEAN, &mddev->flags); create_strip_zones(mddev, &priv_conf); + return priv_conf; } @@ -580,6 +583,7 @@ static void *raid0_takeover_raid10(struct mddev *mddev) mddev->degraded = 0; /* make sure it will be not marked as dirty */ mddev->recovery_cp = MaxSector; + clear_bit(MD_FAILFAST_SUPPORTED, &mddev->flags); create_strip_zones(mddev, &priv_conf); return priv_conf; @@ -622,6 +626,7 @@ static void *raid0_takeover_raid1(struct mddev *mddev) mddev->raid_disks = 1; /* make sure it will be not marked as dirty */ mddev->recovery_cp = MaxSector; + clear_bit(MD_FAILFAST_SUPPORTED, &mddev->flags); create_strip_zones(mddev, &priv_conf); return priv_conf; |