]> git.baikalelectronics.ru Git - kernel.git/commit
md: add new workqueue for delete rdev
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Sat, 4 Apr 2020 21:57:08 +0000 (23:57 +0200)
committerSong Liu <songliubraving@fb.com>
Wed, 13 May 2020 18:22:31 +0000 (11:22 -0700)
commit765ba9ef30aee91bbe54e4eb4f752a5bd3e15a6a
treee6df0755b0de837a1146ac77758a0a47ddc97258
parent80546845d0093f64405b0b31cf3b2da969016f9d
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>
drivers/md/md.c