On 2021/11/29 19:21, Christoph Hellwig wrote: > On Sun, Nov 28, 2021 at 04:42:35PM +0900, Tetsuo Handa wrote: >> Is dropping disk->open_mutex inside lo_release() >> ( https://lkml.kernel.org/r/e4bdc6b1-701d-6cc1-5d42-65564d2aa089@xxxxxxxxxxxxxxxxxxx ) possible? > > I don't think we can drop open_mutex inside ->release. What is the > problem with offloading the clearing to a different context than the > one that calls ->release? > Offloading to a WQ context? If the caller just want to call ioctl(LOOP_CTL_GET_FREE) followed by ioctl(LOOP_CONFIGURE), deferring __loop_clr_fd() would be fine. But the caller might want to unmount as soon as fput(filp) from __loop_clr_fd() completes. I think we need to wait for __loop_clr_fd() from lo_release() to complete.