diff options
author | Yu Kuai <yukuai3@huawei.com> | 2023-12-28 20:55:51 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-02-05 15:23:58 -0800 |
commit | 61c90765e131e63ead773b9b99167415e246a945 (patch) | |
tree | 47089c3a374c58e150385f830737436b56555037 /Documentation/arch | |
parent | 3bca7640b4c50621b94365a1746f4b86116fec56 (diff) |
md: remove redundant check of 'mddev->sync_thread'
The lifetime of sync_thread:
1) Set MD_RECOVERY_NEEDED and wake up daemon thread (by ioctl/sysfs or
other events);
2) Daemon thread woke up, md_check_recovery() found that
MD_RECOVERY_NEEDED is set:
a) try to grab reconfig_mutex;
b) set MD_RECOVERY_RUNNING;
c) clear MD_RECOVERY_NEEDED, and then queue sync_work;
3) md_start_sync() choose sync_action, then register sync_thread;
4) md_do_sync() is done, set MD_RECOVERY_DONE and wake up daemon thread;
5) Daemon thread woke up, md_check_recovery() found that
MD_RECOVERY_DONE is set:
a) try to grab reconfig_mutex;
b) unregister sync_thread;
c) clear MD_RECOVERY_RUNNING and MD_RECOVERY_DONE;
Hence there is no such case that MD_RECOVERY_RUNNING is not set, while
sync_thread is registered.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231228125553.2697765-2-yukuai1@huaweicloud.com
Diffstat (limited to 'Documentation/arch')
0 files changed, 0 insertions, 0 deletions