From: NeilBrown Date: Wed, 9 Nov 2005 05:39:42 +0000 (-0800) Subject: [PATCH] md: ignore auto-readonly flag for arrays where it isn't meaningful X-Git-Tag: v2.6.15-rc1~78 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd9d49cac46f5758d513ccf831b599dd4412546f;p=linux-2.6 [PATCH] md: ignore auto-readonly flag for arrays where it isn't meaningful The 'auto-readonly' flag (which suppresses resync and superblock updates until the first write) is not meaningful for personalities that don't support resync or superblock writes (raid0, linear, etc). So clear the setting early to avoid it confusing anything - e.g. appearing in /proc/mdstat Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 47b8685d4b..25f2bbfe6a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2058,6 +2058,9 @@ static int do_md_run(mddev_t * mddev) } if (mddev->pers->sync_request) sysfs_create_group(&mddev->kobj, &md_redundancy_group); + else if (mddev->ro == 2) /* auto-readonly not meaningful */ + mddev->ro = 0; + atomic_set(&mddev->writes_pending,0); mddev->safemode = 0; mddev->safemode_timer.function = md_safemode_timeout;