Commit db29d79
dm-raid: delay flushing event_work() after reconfig_mutex is released
After commit db5e653 ("md: delay choosing sync action to
md_start_sync()"), md_start_sync() will hold 'reconfig_mutex', however,
in order to make sure event_work is done, __md_stop() will flush
workqueue with reconfig_mutex grabbed, hence if sync_work is still
pending, deadlock will be triggered.
Fortunately, former pacthes to fix stopping sync_thread already make sure
all sync_work is done already, hence such deadlock is not possible
anymore. However, in order not to cause confusions for people by this
implicit dependency, delay flushing event_work to dm-raid where
'reconfig_mutex' is not held, and add some comments to emphasize that
the workqueue can't be flushed with 'reconfig_mutex'.
Fixes: db5e653 ("md: delay choosing sync action to md_start_sync()")
Depends-on: f52f5c7 ("md: fix stopping sync thread")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>1 parent ceb6a6f commit db29d79
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3317 | 3317 | | |
3318 | 3318 | | |
3319 | 3319 | | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
3320 | 3323 | | |
3321 | 3324 | | |
3322 | 3325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
6330 | 6338 | | |
6331 | 6339 | | |
6332 | 6340 | | |
6333 | | - | |
6334 | | - | |
6335 | | - | |
6336 | 6341 | | |
6337 | 6342 | | |
6338 | 6343 | | |
| |||
0 commit comments