summaryrefslogtreecommitdiff
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2023-08-25 06:09:55 +0300
committerSong Liu <song@kernel.org>2023-09-22 20:28:27 +0300
commita2a9f16838509475ea6801f7794a89e03d55e3ed (patch)
treeca7c1070cbd770e27d995c03bc8963813b9d1af7 /drivers/md/md.c
parent158d32af8710777b146f5303a5ca066b493d18e8 (diff)
downloadlinux-a2a9f16838509475ea6801f7794a89e03d55e3ed.tar.xz
md: don't check 'mddev->pers' from suspend_hi_store()
Now that mddev_suspend() doean't rely on 'mddev->pers' to be set, it's safe to remove such checking. This will also allow the array to be suspended even before the array is ran. Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Song Liu <song@kernel.org> Link: https://lore.kernel.org/r/20230825030956.1527023-7-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 889c282a91ea..081b6ec2da52 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5226,18 +5226,13 @@ suspend_hi_store(struct mddev *mddev, const char *buf, size_t len)
err = mddev_lock(mddev);
if (err)
return err;
- err = -EINVAL;
- if (mddev->pers == NULL)
- goto unlock;
mddev_suspend(mddev);
mddev->suspend_hi = new;
mddev_resume(mddev);
- err = 0;
-unlock:
mddev_unlock(mddev);
- return err ?: len;
+ return len;
}
static struct md_sysfs_entry md_suspend_hi =
__ATTR(suspend_hi, S_IRUGO|S_IWUSR, suspend_hi_show, suspend_hi_store);