lkml.org 
[lkml]   [2023]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next 6/7] md: don't check 'mddev->pers' from suspend_hi_store()
Date
From: Yu Kuai <yukuai3@huawei.com>

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>
---
drivers/md/md.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index f14f2f0a9484..a66e00b45be1 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5229,18 +5229,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);
--
2.39.2
\
 
 \ /
  Last update: 2023-08-03 15:34    [W:0.062 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site