Commit 5ce10a3
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.com1 parent df79234 commit 5ce10a3
2 files changed
+33
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
757 | 756 | | |
758 | 757 | | |
759 | 758 | | |
| |||
5021 | 5020 | | |
5022 | 5021 | | |
5023 | 5022 | | |
5024 | | - | |
5025 | | - | |
5026 | | - | |
5027 | | - | |
5028 | | - | |
5029 | | - | |
5030 | | - | |
5031 | | - | |
5032 | | - | |
5033 | | - | |
5034 | | - | |
5035 | | - | |
5036 | | - | |
5037 | | - | |
5038 | | - | |
5039 | | - | |
5040 | | - | |
5041 | | - | |
5042 | | - | |
5043 | | - | |
5044 | | - | |
5045 | | - | |
5046 | | - | |
5047 | | - | |
5048 | | - | |
5049 | | - | |
5050 | | - | |
5051 | | - | |
5052 | 5023 | | |
5053 | 5024 | | |
5054 | 5025 | | |
5055 | 5026 | | |
5056 | 5027 | | |
5057 | 5028 | | |
5058 | 5029 | | |
5059 | | - | |
5060 | | - | |
5061 | | - | |
5062 | | - | |
5063 | | - | |
5064 | | - | |
5065 | | - | |
5066 | | - | |
5067 | | - | |
5068 | 5030 | | |
5069 | 5031 | | |
5070 | 5032 | | |
5071 | 5033 | | |
5072 | 5034 | | |
5073 | | - | |
5074 | | - | |
| 5035 | + | |
5075 | 5036 | | |
5076 | | - | |
5077 | 5037 | | |
5078 | 5038 | | |
5079 | 5039 | | |
| |||
5083 | 5043 | | |
5084 | 5044 | | |
5085 | 5045 | | |
5086 | | - | |
5087 | 5046 | | |
5088 | 5047 | | |
5089 | 5048 | | |
| |||
5097 | 5056 | | |
5098 | 5057 | | |
5099 | 5058 | | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
| 5067 | + | |
| 5068 | + | |
| 5069 | + | |
| 5070 | + | |
| 5071 | + | |
5100 | 5072 | | |
5101 | 5073 | | |
5102 | 5074 | | |
5103 | 5075 | | |
5104 | 5076 | | |
5105 | 5077 | | |
5106 | | - | |
5107 | | - | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
5108 | 5081 | | |
5109 | | - | |
| 5082 | + | |
5110 | 5083 | | |
5111 | 5084 | | |
5112 | 5085 | | |
5113 | 5086 | | |
5114 | 5087 | | |
5115 | 5088 | | |
5116 | | - | |
| 5089 | + | |
| 5090 | + | |
5117 | 5091 | | |
5118 | | - | |
| 5092 | + | |
| 5093 | + | |
5119 | 5094 | | |
5120 | 5095 | | |
5121 | 5096 | | |
5122 | 5097 | | |
5123 | 5098 | | |
5124 | | - | |
| 5099 | + | |
| 5100 | + | |
5125 | 5101 | | |
5126 | 5102 | | |
5127 | 5103 | | |
5128 | 5104 | | |
5129 | | - | |
| 5105 | + | |
5130 | 5106 | | |
5131 | 5107 | | |
5132 | 5108 | | |
| |||
5144 | 5120 | | |
5145 | 5121 | | |
5146 | 5122 | | |
5147 | | - | |
| 5123 | + | |
| 5124 | + | |
5148 | 5125 | | |
5149 | 5126 | | |
5150 | 5127 | | |
5151 | 5128 | | |
5152 | 5129 | | |
5153 | 5130 | | |
5154 | 5131 | | |
5155 | | - | |
5156 | 5132 | | |
5157 | 5133 | | |
5158 | 5134 | | |
| 5135 | + | |
5159 | 5136 | | |
5160 | 5137 | | |
5161 | 5138 | | |
5162 | | - | |
| 5139 | + | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
| 5143 | + | |
5163 | 5144 | | |
5164 | 5145 | | |
5165 | 5146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
599 | | - | |
600 | 598 | | |
601 | 599 | | |
602 | 600 | | |
| |||
0 commit comments