[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d648e6f0-ad19-4428-9e0d-f6ce609faacf@huaweicloud.com>
Date: Thu, 8 Jan 2026 11:31:13 +0800
From: Zheng Qixing <zhengqixing@...weicloud.com>
To: Li Nan <linan666@...weicloud.com>
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
yi.zhang@...wei.com, yangerkun@...wei.com, houtao1@...wei.com,
linan122@...artners.com, Song Liu <song@...nel.org>, yukuai@...as.com,
zhengqixing@...wei.com
Subject: Re: [RFC PATCH 1/5] md: add helpers for requested sync action
在 2026/1/6 20:59, Li Nan 写道:
>>
>> +
>> +static int handle_requested_sync_action(struct mddev *mddev,
>> + enum sync_action action)
>> +{
>> + if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
>> + return -EBUSY;
>
> This return change origin logic; split factor out and fix into two
> patches.
Make sense to me.
>
>> + return __handle_requested_sync_action(mddev, action);
>> +}
>> +
>
> __handle_requested_sync_action does not need to be split.
>
>> +static enum sync_action __get_recovery_sync_action(struct mddev *mddev)
>> +{
>> + if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
>> + return ACTION_CHECK;
>> + if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
>> + return ACTION_REPAIR;
>> + return ACTION_RESYNC;
>> +}
>> +
>> +static enum sync_action get_recovery_sync_action(struct mddev *mddev)
>> +{
>> + return __get_recovery_sync_action(mddev);
>> +}
>> +
>
> __get_recovery_sync_action also does not need to be split.
>
Okay.
>
>> +static void init_recovery_position(struct mddev *mddev)
>> +{
>> + mddev->resync_min = 0;
>> +}
>> +
>> +static void set_requested_position(struct mddev *mddev, sector_t value)
>> +{
>> + mddev->resync_min = value;
>> +}
>> +
>> +static sector_t get_requested_position(struct mddev *mddev)
>> +{
>> + return mddev->resync_min;
>> +}
>> +
>
> There is no need to factor the operations of resync_min;
> 'rectify_min' that follows can re-use 'resync_min' directly.
>
If we share resync_min with check/repair, bad blocks may be missed
during repair:
When check/repair is halfway through execution and then frozen,
followed by a rectify operation, any bad blocks that exist before
resync_min will not be repaired. This would require an additional
rectify operation.
Thanks,
Qixing
Powered by blists - more mailing lists