diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 43d033d9a05a..912ed04adcff 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4973,14 +4973,12 @@ static int md_ioctl(struct inode *inode, struct file *file, | |||
4973 | * here and hit the 'default' below, so only disallow | 4973 | * here and hit the 'default' below, so only disallow |
4974 | * 'md' ioctls, and switch to rw mode if started auto-readonly. | 4974 | * 'md' ioctls, and switch to rw mode if started auto-readonly. |
4975 | */ | 4975 | */ |
4976 | if (_IOC_TYPE(cmd) == MD_MAJOR && | 4976 | if (_IOC_TYPE(cmd) == MD_MAJOR && mddev->ro && mddev->pers) { |
4977 | mddev->ro && mddev->pers) { | ||
4978 | if (mddev->ro == 2) { | 4977 | if (mddev->ro == 2) { |
4979 | mddev->ro = 0; | 4978 | mddev->ro = 0; |
4980 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | 4979 | sysfs_notify(&mddev->kobj, NULL, "array_state"); |
4981 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 4980 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
4982 | md_wakeup_thread(mddev->thread); | 4981 | md_wakeup_thread(mddev->thread); |
4983 | |||
4984 | } else { | 4982 | } else { |
4985 | err = -EROFS; | 4983 | err = -EROFS; |
4986 | goto abort_unlock; | 4984 | goto abort_unlock; |