* [PATCH v2] md: use MD_RESYNC_* whenever possible
@ 2023-02-01 7:59 Hou Tao
2023-02-01 16:31 ` Song Liu
2023-02-01 16:58 ` Logan Gunthorpe
0 siblings, 2 replies; 3+ messages in thread
From: Hou Tao @ 2023-02-01 7:59 UTC (permalink / raw)
To: linux-raid; +Cc: Song Liu, Jens Axboe, Logan Gunthorpe, houtao1
From: Hou Tao <houtao1@huawei.com>
Just replace magic numbers by MD_RESYNC_* enumerations.
Signed-off-by: Hou Tao <houtao1@huawei.com>
---
v2: rebased on md-next
v1: https://lore.kernel.org/linux-raid/025148b5-f213-86a8-2c1d-ac76c52f7165@huaweicloud.com
drivers/md/md.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index da6370835c47..a1635fe82e3d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6166,7 +6166,7 @@ static void md_clean(struct mddev *mddev)
mddev->new_level = LEVEL_NONE;
mddev->new_layout = 0;
mddev->new_chunk_sectors = 0;
- mddev->curr_resync = 0;
+ mddev->curr_resync = MD_RESYNC_NONE;
atomic64_set(&mddev->resync_mismatches, 0);
mddev->suspend_lo = mddev->suspend_hi = 0;
mddev->sync_speed_min = mddev->sync_speed_max = 0;
@@ -8895,7 +8895,7 @@ void md_do_sync(struct md_thread *thread)
atomic_set(&mddev->recovery_active, 0);
last_check = 0;
- if (j>2) {
+ if (j >= MD_RESYNC_ACTIVE) {
pr_debug("md: resuming %s of %s from checkpoint.\n",
desc, mdname(mddev));
mddev->curr_resync = j;
@@ -8967,7 +8967,7 @@ void md_do_sync(struct md_thread *thread)
if (j > max_sectors)
/* when skipping, extra large numbers can be returned. */
j = max_sectors;
- if (j > 2)
+ if (j >= MD_RESYNC_ACTIVE)
mddev->curr_resync = j;
mddev->curr_mark_cnt = io_sectors;
if (last_check == 0)
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] md: use MD_RESYNC_* whenever possible
2023-02-01 7:59 [PATCH v2] md: use MD_RESYNC_* whenever possible Hou Tao
@ 2023-02-01 16:31 ` Song Liu
2023-02-01 16:58 ` Logan Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Song Liu @ 2023-02-01 16:31 UTC (permalink / raw)
To: Hou Tao; +Cc: linux-raid, Jens Axboe, Logan Gunthorpe, houtao1
On Tue, Jan 31, 2023 at 11:31 PM Hou Tao <houtao@huaweicloud.com> wrote:
>
> From: Hou Tao <houtao1@huawei.com>
>
> Just replace magic numbers by MD_RESYNC_* enumerations.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
Applied to md-next. Thanks!
Song
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] md: use MD_RESYNC_* whenever possible
2023-02-01 7:59 [PATCH v2] md: use MD_RESYNC_* whenever possible Hou Tao
2023-02-01 16:31 ` Song Liu
@ 2023-02-01 16:58 ` Logan Gunthorpe
1 sibling, 0 replies; 3+ messages in thread
From: Logan Gunthorpe @ 2023-02-01 16:58 UTC (permalink / raw)
To: Hou Tao, linux-raid; +Cc: Song Liu, Jens Axboe, houtao1
On 2023-02-01 00:59, Hou Tao wrote:
> From: Hou Tao <houtao1@huawei.com>
>
> Just replace magic numbers by MD_RESYNC_* enumerations.
>
> Signed-off-by: Hou Tao <houtao1@huawei.com>
Looks good to me. Thanks
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Logan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-01 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 7:59 [PATCH v2] md: use MD_RESYNC_* whenever possible Hou Tao
2023-02-01 16:31 ` Song Liu
2023-02-01 16:58 ` Logan Gunthorpe
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.