All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Xiao Ni <xni@redhat.com>
Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org
Subject: Re: [PATCH 02/10] mdadm/Grow: Update reshape_progress to need_back after reshape finishes
Date: Mon, 2 Sep 2024 11:55:37 +0200	[thread overview]
Message-ID: <20240902115537.000046d4@linux.intel.com> (raw)
In-Reply-To: <20240828021150.63240-3-xni@redhat.com>

On Wed, 28 Aug 2024 10:11:42 +0800
Xiao Ni <xni@redhat.com> wrote:

> It tries to update data offset when kicking off reshape. If it can't
> change data offset, it needs to use child_monitor to monitor reshape
> progress and do back up job. And it needs to update reshape_progress
> to need_back when reshape finishes. If not, it will be in a infinite
> loop.
> 
> Signed-off-by: Xiao Ni <xni@redhat.com>
> ---
>  Grow.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/Grow.c b/Grow.c
> index 97e48d86a33f..6b621aea4ecc 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -4142,8 +4142,7 @@ int progress_reshape(struct mdinfo *info, struct
> reshape *reshape,
>  		 * waiting forever on a dead array
>  		 */
>  		char action[SYSFS_MAX_BUF_SIZE];
> -		if (sysfs_get_str(info, NULL, "sync_action", action,
> sizeof(action)) <= 0 ||
> -		    strncmp(action, "reshape", 7) != 0)
> +		if (sysfs_get_str(info, NULL, "sync_action", action,
> sizeof(action)) <= 0) break;

There must be empty line after declaration.


>  		/* Some kernels reset 'sync_completed' to zero
>  		 * before setting 'sync_action' to 'idle'.
> @@ -4151,12 +4150,18 @@ int progress_reshape(struct mdinfo *info, struct
> reshape *reshape, */
>  		if (completed == 0 && advancing &&
>  		    strncmp(action, "idle", 4) == 0 &&
> -		    info->reshape_progress > 0)
> +		    info->reshape_progress > 0) {
> +			info->reshape_progress = need_backup;
>  			break;
> +		}
>  		if (completed == 0 && !advancing &&
>  		    strncmp(action, "idle", 4) == 0 &&
>  		    info->reshape_progress <
> -		    (info->component_size * reshape->after.data_disks))
> +		    (info->component_size * reshape->after.data_disks)) {
> +			info->reshape_progress = need_backup;
> +			break;

This look weird to assign need_backup (suggests boolean field) to
reshape_progress but it is not your code so you have my ack.

Thanks,
Mariusz

> +		}
> +		if (strncmp(action, "reshape", 7) != 0)
>  			break;
>  		sysfs_wait(fd, NULL);
>  		if (sysfs_fd_get_ll(fd, &completed) < 0)


  reply	other threads:[~2024-09-02  9:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  2:11 [PATCH 00/10] mdadm tests fix Xiao Ni
2024-08-28  2:11 ` [PATCH 01/10] mdadm/Grow: Update new level when starting reshape Xiao Ni
2024-09-02  9:50   ` Mariusz Tkaczyk
2024-09-02 10:10     ` Mariusz Tkaczyk
2024-09-03  0:34       ` Xiao Ni
2024-09-03  7:34         ` Mariusz Tkaczyk
2024-09-03 10:11           ` Xiao Ni
2024-09-03  0:32     ` Xiao Ni
2024-08-28  2:11 ` [PATCH 02/10] mdadm/Grow: Update reshape_progress to need_back after reshape finishes Xiao Ni
2024-09-02  9:55   ` Mariusz Tkaczyk [this message]
2024-08-28  2:11 ` [PATCH 03/10] mdadm/Grow: Can't open raid when running --grow --continue Xiao Ni
2024-09-02 10:00   ` Mariusz Tkaczyk
2024-08-28  2:11 ` [PATCH 04/10] mdadm/Grow: sleep a while after removing disk in impose_level Xiao Ni
     [not found]   ` <20240902121359.00007a84@linux.intel.com>
2024-09-03  0:53     ` Xiao Ni
2024-09-03  7:22       ` Mariusz Tkaczyk
2024-09-11  8:42         ` Xiao Ni
2024-08-28  2:11 ` [PATCH 05/10] mdadm/tests: wait until level changes Xiao Ni
2024-08-28  2:11 ` [PATCH 06/10] mdadm/tests: 07changelevels fix Xiao Ni
2024-08-28  2:11 ` [PATCH 07/10] mdadm/tests: Remove 07reshape5intr.broken Xiao Ni
2024-08-28  2:11 ` [PATCH 08/10] mdadm/tests: 07testreshape5 fix Xiao Ni
2024-08-28  2:11 ` [PATCH 09/10] mdadm/tests: remove 09imsm-assemble.broken Xiao Ni
2024-08-28  2:11 ` [PATCH 10/10] mdadm/Manage: record errno Xiao Ni

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=20240902115537.000046d4@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=ncroxon@redhat.com \
    --cc=xni@redhat.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.