summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2015-10-08 21:54:11 -0700
committerNeilBrown <neilb@suse.com>2015-11-01 13:48:29 +1100
commita3dfbdaadba2612faf11f025b8156c36e3700247 (patch)
tree4813e5ebf37b2c15b01d9b93b9b54435e2a81f8a /drivers/md/md.c
parent7dde2ad3c5b4afb4b2544b864fa34dd1f4897ab6 (diff)
downloadop-kernel-dev-a3dfbdaadba2612faf11f025b8156c36e3700247.zip
op-kernel-dev-a3dfbdaadba2612faf11f025b8156c36e3700247.tar.gz
MD: kick out journal disk if it's not fresh
When journal disk is faulty and we are reassemabling the raid array, the journal disk is old. We don't allow the journal disk added to the raid array. Since journal disk is missing in the array, the raid5 will mark the array readonly. Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bca859a..f67cd5b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1608,7 +1608,8 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev)
++ev1;
if (rdev->desc_nr >= 0 &&
rdev->desc_nr < le32_to_cpu(sb->max_dev) &&
- le16_to_cpu(sb->dev_roles[rdev->desc_nr]) < MD_DISK_ROLE_MAX)
+ (le16_to_cpu(sb->dev_roles[rdev->desc_nr]) < MD_DISK_ROLE_MAX ||
+ le16_to_cpu(sb->dev_roles[rdev->desc_nr]) == MD_DISK_ROLE_JOURNAL))
if (ev1 < mddev->events)
return -EINVAL;
} else if (mddev->bitmap) {
OpenPOWER on IntegriCloud