On Wed, 24 Nov 2021 19:47:40 +0900, Tetsuo Handa wrote: > syzbot is reporting circular locking problem at __loop_clr_fd() [1], for > commit 87579e9b7d8dc36e ("loop: use worker per cgroup instead of kworker") > is calling destroy_workqueue() with lo->lo_mutex held. > > Since all functions where lo->lo_state matters are already checking > lo->lo_state with lo->lo_mutex held (in order to avoid racing with e.g. > ioctl(LOOP_CTL_REMOVE)), and __loop_clr_fd() can be called from either > ioctl(LOOP_CLR_FD) xor close(), lo->lo_state == Lo_rundown is considered > as an exclusive lock for __loop_clr_fd(). Therefore, hold lo->lo_mutex > inside __loop_clr_fd() only when asserting/updating lo->lo_state. > > [...] Applied, thanks! [1/1] loop: don't hold lo_mutex during __loop_clr_fd() commit: c895b784c699224d690c7dfbdcff309df82366e3 Best regards, -- Jens Axboe