diff options
author | Yu Kuai <yukuai3@huawei.com> | 2023-08-25 11:09:56 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2023-09-22 10:28:27 -0700 |
commit | 54d21eb6ad5e57e70157590397ba01b9faed6b59 (patch) | |
tree | 1dc1344980ce2430a6069e9075385d2a279c19c0 /drivers/md | |
parent | a2a9f16838509475ea6801f7794a89e03d55e3ed (diff) | |
download | linux-54d21eb6ad5e57e70157590397ba01b9faed6b59.tar.gz linux-54d21eb6ad5e57e70157590397ba01b9faed6b59.tar.bz2 linux-54d21eb6ad5e57e70157590397ba01b9faed6b59.zip |
md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_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-8-yukuai1@huaweicloud.com
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 081b6ec2da52..10cb4dfbf4ae 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5189,18 +5189,13 @@ suspend_lo_store(struct mddev *mddev, const char *buf, size_t len) err = mddev_lock(mddev); if (err) return err; - err = -EINVAL; - if (mddev->pers == NULL || - mddev->pers->quiesce == NULL) - goto unlock; + mddev_suspend(mddev); mddev->suspend_lo = new; mddev_resume(mddev); - err = 0; -unlock: mddev_unlock(mddev); - return err ?: len; + return len; } static struct md_sysfs_entry md_suspend_lo = __ATTR(suspend_lo, S_IRUGO|S_IWUSR, suspend_lo_show, suspend_lo_store); |