From: Yu Kuai <yukuai1@huaweicloud.com> To: agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, song@kernel.org, xni@redhat.com Cc: yi.zhang@huawei.com, yangerkun@huawei.com, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai1@huaweicloud.com, yukuai3@huawei.com Subject: [dm-devel] [PATCH -next v2 7/7] md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() Date: Fri, 25 Aug 2023 11:09:56 +0800 [thread overview] Message-ID: <20230825030956.1527023-8-yukuai1@huaweicloud.com> (raw) In-Reply-To: <20230825030956.1527023-1-yukuai1@huaweicloud.com> 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 558cc752eb00..470986943e74 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5180,18 +5180,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); -- 2.39.2 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel
WARNING: multiple messages have this Message-ID (diff)
From: Yu Kuai <yukuai1@huaweicloud.com> To: agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, song@kernel.org, xni@redhat.com Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH -next v2 7/7] md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() Date: Fri, 25 Aug 2023 11:09:56 +0800 [thread overview] Message-ID: <20230825030956.1527023-8-yukuai1@huaweicloud.com> (raw) In-Reply-To: <20230825030956.1527023-1-yukuai1@huaweicloud.com> 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 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 558cc752eb00..470986943e74 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5180,18 +5180,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); -- 2.39.2
next prev parent reply other threads:[~2023-08-25 3:14 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-25 3:09 [dm-devel] [PATCH -next v2 0/7] md: initialize 'active_io' while allocating mddev Yu Kuai 2023-08-25 3:09 ` Yu Kuai 2023-08-25 3:09 ` [dm-devel] [PATCH -next v2 1/7] " Yu Kuai 2023-08-25 3:09 ` Yu Kuai 2023-08-25 3:09 ` [dm-devel] [PATCH -next v2 2/7] md: initialize 'writes_pending' " Yu Kuai 2023-08-25 3:09 ` Yu Kuai 2023-08-25 3:09 ` [PATCH -next v2 3/7] md: don't rely on 'mddev->pers' to be set in mddev_suspend() Yu Kuai 2023-08-25 3:09 ` [dm-devel] " Yu Kuai 2023-08-25 3:09 ` [PATCH -next v2 4/7] md-bitmap: remove the checking of 'pers->quiesce' from location_store() Yu Kuai 2023-08-25 3:09 ` [dm-devel] " Yu Kuai 2023-08-25 3:09 ` [dm-devel] [PATCH -next v2 5/7] md-bitmap: suspend array earlier in location_store() Yu Kuai 2023-08-25 3:09 ` Yu Kuai 2023-08-25 3:09 ` [PATCH -next v2 6/7] md: don't check 'mddev->pers' from suspend_hi_store() Yu Kuai 2023-08-25 3:09 ` [dm-devel] " Yu Kuai 2023-08-25 3:09 ` Yu Kuai [this message] 2023-08-25 3:09 ` [PATCH -next v2 7/7] md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() Yu Kuai 2023-08-25 6:40 ` [PATCH -next v2 0/7] md: initialize 'active_io' while allocating mddev Song Liu 2023-08-25 6:40 ` [dm-devel] " Song Liu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230825030956.1527023-8-yukuai1@huaweicloud.com \ --to=yukuai1@huaweicloud.com \ --cc=agk@redhat.com \ --cc=dm-devel@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-raid@vger.kernel.org \ --cc=snitzer@kernel.org \ --cc=song@kernel.org \ --cc=xni@redhat.com \ --cc=yangerkun@huawei.com \ --cc=yi.zhang@huawei.com \ --cc=yukuai3@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.