On 2022/03/16 20:25, Jan Kara wrote: > On Wed 16-03-22 09:45:19, Christoph Hellwig wrote: >> There is no need to destroy the workqueue when clearing unbinding >> a loop device from a backing file. Not doing so on the other hand >> avoid creating a complex lock dependency chain involving the global >> system_transition_mutex. >> >> Based on a patch from Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>. >> >> Reported-by: syzbot+6479585dfd4dedd3f7e1@xxxxxxxxxxxxxxxxxxxxxxxxx >> Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > Looks good. Feel free to add: > > Reviewed-by: Jan Kara <jack@xxxxxxx> I don't recommend this change. Since this WQ is invoked when flushing data to disk, this WQ had better use WQ_MEM_RECLAIM flag when creating. A WQ created with WQ_MEM_RECLAIM flag has at least one "struct task_struct" in order to guarantee forward progress, but results in consuming more kernel resources. Therefore, it is preferable to destroy the WQ when clearing unbinding a loop device from a backing file.