From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: xni@redhat.com, song@kernel.org, linux-raid@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai3@huawei.com,
yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH -next v2 2/7] md: factor out a helper to choose sync direction from md_check_recovery()
Date: Thu, 17 Aug 2023 09:58:14 +0200 [thread overview]
Message-ID: <20230817095814.00005530@linux.intel.com> (raw)
In-Reply-To: <20230815030957.509535-3-yukuai1@huaweicloud.com>
On Tue, 15 Aug 2023 11:09:52 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:
> From: Yu Kuai <yukuai3@huawei.com>
>
> There are no functional changes, on the one hand make the code cleaner,
> on the other hand prevent following checkpatch error in the next patch to
> delay choosing sync direction to md_start_sync().
>
> ERROR: do not use assignment in if condition
> + } else if ((spares = remove_and_add_spares(mddev, NULL))) {
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
> drivers/md/md.c | 68 +++++++++++++++++++++++++++++++------------------
> 1 file changed, 43 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 90815be1e80f..4846ff6d25b0 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -9246,6 +9246,48 @@ static int remove_and_add_spares(struct mddev *mddev,
> return spares;
> }
>
> +static bool md_choose_sync_direction(struct mddev *mddev, int *spares)
The naming is little confusing because as a direction I would expect forward or
backward - from end to start or or from start to end. In this case you are
determining the type of the background operation needed. Assuming that reshape
is a kind of "sync" operation I would say "md_choose_sync_action".
Anyway, it looks good to me.
Thanks,
Mariusz
next prev parent reply other threads:[~2023-08-17 7:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 3:09 [PATCH -next v2 0/7] md: make rdev addition and removal independent from daemon thread Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 1/7] md: use separate work_struct for md_start_sync() Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 2/7] md: factor out a helper to choose sync direction from md_check_recovery() Yu Kuai
2023-08-17 7:58 ` Mariusz Tkaczyk [this message]
2023-08-17 21:49 ` Song Liu
2023-08-20 1:44 ` Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 3/7] md: delay choosing sync direction to md_start_sync() Yu Kuai
2023-08-15 6:00 ` Yu Kuai
2023-08-15 15:54 ` Song Liu
2023-08-16 1:07 ` Yu Kuai
2023-08-17 21:53 ` Song Liu
2023-08-20 1:45 ` Yu Kuai
2023-08-16 6:38 ` Xiao Ni
2023-08-20 2:04 ` Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 4/7] md: factor out a helper rdev_removeable() from remove_and_add_spares() Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 5/7] md: factor out a helper rdev_is_spare() " Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 6/7] md: factor out a helper rdev_addable() " Yu Kuai
2023-08-15 3:09 ` [PATCH -next v2 7/7] md: delay remove_and_add_spares() for read only array to md_start_sync() Yu Kuai
2023-08-16 7:18 ` Xiao Ni
2023-08-20 2:19 ` Yu Kuai
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=20230817095814.00005530@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=xni@redhat.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.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: link
Be 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.