Commit cc1ffe6
md: add new workqueue for delete rdev
Since the purpose of call flush_workqueue in new_dev_store is to ensure
md_delayed_delete() has completed, so we should check rdev->del_work is
pending or not.
To suppress lockdep warning, we have to check mddev->del_work while
md_delayed_delete is attached to rdev->del_work, so it is not aligned
to the purpose of flush workquee. So a new workqueue is needed to avoid
the awkward situation, and introduce a new func flush_rdev_wq to flush
the new workqueue after check if there was pending work.
Also like new_dev_store, ADD_NEW_DISK ioctl has the same purpose to flush
workqueue while it holds bdev->bd_mutex, so make the same change applies
to the ioctl to avoid similar lock issue.
And md_delayed_delete actually wants to delete rdev, so rename the function
to rdev_delayed_delete.
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Song Liu <songliubraving@fb.com>1 parent 21e0958 commit cc1ffe6
1 file changed
+29
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
2454 | 2455 | | |
2455 | 2456 | | |
2456 | 2457 | | |
2457 | | - | |
| 2458 | + | |
2458 | 2459 | | |
2459 | 2460 | | |
2460 | 2461 | | |
| |||
2479 | 2480 | | |
2480 | 2481 | | |
2481 | 2482 | | |
2482 | | - | |
| 2483 | + | |
2483 | 2484 | | |
2484 | | - | |
| 2485 | + | |
2485 | 2486 | | |
2486 | 2487 | | |
2487 | 2488 | | |
| |||
4514 | 4515 | | |
4515 | 4516 | | |
4516 | 4517 | | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
4517 | 4532 | | |
4518 | 4533 | | |
4519 | 4534 | | |
| |||
4541 | 4556 | | |
4542 | 4557 | | |
4543 | 4558 | | |
4544 | | - | |
4545 | | - | |
| 4559 | + | |
4546 | 4560 | | |
4547 | 4561 | | |
4548 | 4562 | | |
| |||
4780 | 4794 | | |
4781 | 4795 | | |
4782 | 4796 | | |
4783 | | - | |
| 4797 | + | |
| 4798 | + | |
4784 | 4799 | | |
4785 | 4800 | | |
4786 | 4801 | | |
| |||
7498 | 7513 | | |
7499 | 7514 | | |
7500 | 7515 | | |
7501 | | - | |
7502 | | - | |
| 7516 | + | |
7503 | 7517 | | |
7504 | 7518 | | |
7505 | 7519 | | |
| |||
9471 | 9485 | | |
9472 | 9486 | | |
9473 | 9487 | | |
| 9488 | + | |
| 9489 | + | |
| 9490 | + | |
| 9491 | + | |
9474 | 9492 | | |
9475 | 9493 | | |
9476 | 9494 | | |
| |||
9492 | 9510 | | |
9493 | 9511 | | |
9494 | 9512 | | |
| 9513 | + | |
| 9514 | + | |
9495 | 9515 | | |
9496 | 9516 | | |
9497 | 9517 | | |
| |||
9778 | 9798 | | |
9779 | 9799 | | |
9780 | 9800 | | |
| 9801 | + | |
9781 | 9802 | | |
9782 | 9803 | | |
9783 | 9804 | | |
| |||
0 commit comments