summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5-cache.c
diff options
context:
space:
mode:
authorShaohua Li2015-10-09 06:54:10 +0200
committerNeilBrown2015-11-01 03:48:29 +0100
commit7dde2ad3c5b4afb4b2544b864fa34dd1f4897ab6 (patch)
tree301d84d8773e13a6b815355446b485ed3dcfc595 /drivers/md/raid5-cache.c
parentMD: add new bit to indicate raid array with journal (diff)
downloadkernel-qcow2-linux-7dde2ad3c5b4afb4b2544b864fa34dd1f4897ab6.tar.gz
kernel-qcow2-linux-7dde2ad3c5b4afb4b2544b864fa34dd1f4897ab6.tar.xz
kernel-qcow2-linux-7dde2ad3c5b4afb4b2544b864fa34dd1f4897ab6.zip
raid5-cache: start raid5 readonly if journal is missing
If raid array is expected to have journal (eg, journal is set in MD superblock feature map) and the array is started without journal disk, start the array readonly. Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r--drivers/md/raid5-cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 62e5fe4afae8..b887e04d7e5c 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -806,8 +806,9 @@ void r5l_quiesce(struct r5l_log *log, int state)
bool r5l_log_disk_error(struct r5conf *conf)
{
+ /* don't allow write if journal disk is missing */
if (!conf->log)
- return false;
+ return test_bit(MD_HAS_JOURNAL, &conf->mddev->flags);
return test_bit(Faulty, &conf->log->rdev->flags);
}