On Thu, 2018-10-25 at 19:02 +0200, Johannes Berg wrote: > On Thu, 2018-10-25 at 15:05 +0000, Bart Van Assche wrote: > > It can happen that the direct I/O queue creates and destroys an empty > > workqueue from inside a work function. > > So, thinking about this more, can you guarantee (somehow) that the > workqueue is empty at this point?
In general, no. But for the direct I/O case this can be guaranteed. Please have a look at the code in sb_init_dio_done_wq() if you would not yet have done this. > Do you know how to reproduce this? The lockdep complaint in the patch description is easy to reproduce. The way I reproduce it is as follows: git clone https://github.com/osandov/blktests (cd blktests && ./check -q nvmeof-mp) Bart.

