lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <966113b2-3c5b-92e0-4c8d-12acb731b485@huaweicloud.com>
Date: Tue, 6 Jan 2026 21:24:26 +0800
From: Li Nan <linan666@...weicloud.com>
To: Zheng Qixing <zhengqixing@...weicloud.com>, song@...nel.org,
 yukuai@...as.com
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
 yi.zhang@...wei.com, yangerkun@...wei.com, houtao1@...wei.com,
 zhengqixing@...wei.com, linan122@...artners.com
Subject: Re: [RFC PATCH 3/5] md: simplify sync action print in status_resync



在 2025/12/31 15:09, Zheng Qixing 写道:
> From: Zheng Qixing <zhengqixing@...wei.com>
> 
> No functional change, just code cleanup to make it easier to add new
> sync actions later.
> 
> Signed-off-by: Zheng Qixing <zhengqixing@...wei.com>
> ---
>   drivers/md/md.c | 16 +++++++++-------
>   1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 52e09a9a9288..9eeab5258189 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -8684,6 +8684,8 @@ static int status_resync(struct seq_file *seq, struct mddev *mddev)
>   	sector_t rt, curr_mark_cnt, resync_mark_cnt;
>   	int scale, recovery_active;
>   	unsigned int per_milli;
> +	enum sync_action action;
> +	const char *sync_action_name;
>   
>   	if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
>   	    test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
> @@ -8765,13 +8767,13 @@ static int status_resync(struct seq_file *seq, struct mddev *mddev)
>   			seq_printf(seq, ".");
>   		seq_printf(seq, "] ");
>   	}
> -	seq_printf(seq, " %s =%3u.%u%% (%llu/%llu)",
> -		   (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)?
> -		    "reshape" :
> -		    (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)?
> -		     "check" :
> -		     (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ?
> -		      "resync" : "recovery"))),
> +
> +	action = md_sync_action(mddev);
> +	if (action == ACTION_RECOVER)
> +		sync_action_name = "recovery";

Why not use md_sync_action_name for ACTION_RECOVER?

> +	else
> +		sync_action_name = md_sync_action_name(action);
> +	seq_printf(seq, " %s =%3u.%u%% (%llu/%llu)", sync_action_name,
>   		   per_milli/10, per_milli % 10,
>   		   (unsigned long long) resync/2,
>   		   (unsigned long long) max_sectors/2);

-- 
Thanks,
Nan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ