diff options
author | Song Liu <songliubraving@fb.com> | 2016-08-19 18:34:01 -0400 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-08-24 13:21:50 -0400 |
commit | 486b0f7bcd64be027535811ef44195bc1027fbd3 (patch) | |
tree | b9b3e488a4202e79562a7b642741462a085cc16a /drivers/md/raid5.c | |
parent | c622ca543bff8e73efacf4dafa0cc9851ecea511 (diff) |
r5cache: set MD_JOURNAL_CLEAN correctly
Currently, the code sets MD_JOURNAL_CLEAN when the array has
MD_FEATURE_JOURNAL and the recovery_cp is MaxSector. The array
will be MD_JOURNAL_CLEAN even if the journal device is missing.
With this patch, the MD_JOURNAL_CLEAN is only set when the journal
device presents.
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 4f8f5242ea3b..2119e094dfb3 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -6840,11 +6840,14 @@ static int raid5_run(struct mddev *mddev) | |||
6840 | if (IS_ERR(conf)) | 6840 | if (IS_ERR(conf)) |
6841 | return PTR_ERR(conf); | 6841 | return PTR_ERR(conf); |
6842 | 6842 | ||
6843 | if (test_bit(MD_HAS_JOURNAL, &mddev->flags) && !journal_dev) { | 6843 | if (test_bit(MD_HAS_JOURNAL, &mddev->flags)) { |
6844 | printk(KERN_ERR "md/raid:%s: journal disk is missing, force array readonly\n", | 6844 | if (!journal_dev) { |
6845 | mdname(mddev)); | 6845 | pr_err("md/raid:%s: journal disk is missing, force array readonly\n", |
6846 | mddev->ro = 1; | 6846 | mdname(mddev)); |
6847 | set_disk_ro(mddev->gendisk, 1); | 6847 | mddev->ro = 1; |
6848 | set_disk_ro(mddev->gendisk, 1); | ||
6849 | } else if (mddev->recovery_cp == MaxSector) | ||
6850 | set_bit(MD_JOURNAL_CLEAN, &mddev->flags); | ||
6848 | } | 6851 | } |
6849 | 6852 | ||
6850 | conf->min_offset_diff = min_offset_diff; | 6853 | conf->min_offset_diff = min_offset_diff; |