diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-06-11 21:22:46 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-06-12 16:27:50 +0000 |
commit | 5ce10a38590c77f20d0dc706944f79e7d56a7400 (patch) | |
tree | 8a3f3e25e142b5fce5734b99aa5bb6f3e8fcd90c /rust/helpers.c | |
parent | df79234bdc3f441bec99dfc8199b6f2c673203ed (diff) |
md: don't fail action_store() if sync_thread is not registered
MD_RECOVERY_RUNNING will always be set when trying to register a new
sync_thread, however, if md_start_sync() turns out to do nothing,
MD_RECOVERY_RUNNING will be cleared in this case. And during the race
window, action_store() will return -EBUSY, which will cause some
mdadm tests to fail. For example:
The test 07reshape5intr will add a new disk to array, then start
reshape:
mdadm /dev/md0 --add /dev/xxx
mdadm --grow /dev/md0 -n 3
And add_bound_rdev() from mdadm --add will set MD_RECOVERY_NEEDED,
then during the race windown, mdadm --grow will fail.
Fix the problem by waiting in action_store() during the race window,
fail only if 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/20240611132251.1967786-8-yukuai1@huaweicloud.com
Diffstat (limited to 'rust/helpers.c')
0 files changed, 0 insertions, 0 deletions