diff options
author | Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> | 2021-12-13 13:55:27 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-12-13 19:37:31 +0100 |
commit | 322c4293ecc58110227b49d7e47ae37b9b03566f (patch) | |
tree | 7d80878419583add4b5626aa41c696446814ac48 /drivers/block/loop.h | |
parent | null_blk: cast command status to integer (diff) | |
download | linux-322c4293ecc58110227b49d7e47ae37b9b03566f.tar.xz linux-322c4293ecc58110227b49d7e47ae37b9b03566f.zip |
loop: make autoclear operation asynchronous
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 disk->open_mutex held.
This circular dependency cannot be broken unless we call __loop_clr_fd()
without holding disk->open_mutex. Therefore, defer __loop_clr_fd() from
lo_release() to a WQ context.
Link: https://syzkaller.appspot.com/bug?extid=643e4ce4b6ad1347d372 [1]
Reported-by: syzbot <syzbot+643e4ce4b6ad1347d372@syzkaller.appspotmail.com>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>
Tested-by: syzbot+643e4ce4b6ad1347d372@syzkaller.appspotmail.com
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/1ed7df28-ebd6-71fb-70e5-1c2972e05ddb@i-love.sakura.ne.jp
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | drivers/block/loop.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/loop.h b/drivers/block/loop.h index 082d4b6bfc6a..918a7a2dc025 100644 --- a/drivers/block/loop.h +++ b/drivers/block/loop.h @@ -56,6 +56,7 @@ struct loop_device { struct gendisk *lo_disk; struct mutex lo_mutex; bool idr_visible; + struct work_struct rundown_work; }; struct loop_cmd { |