block: serialize all debugfs operations using q->debugfs_mutex
Various places like I/O schedulers or the QOS infrastructure try to register debugfs files on demans, which can race with creating and removing the main queue debugfs directory. Use the existing debugfs_mutex to serialize all debugfs operations that rely on q->debugfs_dir or the directories hanging off it. To make the teardown code a little simpler declare all debugfs dentry pointers and not just the main one uncoditionally in blkdev.h. Move debugfs_mutex next to the dentries that it protects and document what it is used for. Signed-off-by:Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220614074827.458955-3-hch@lst.de Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Showing
- block/blk-mq-debugfs.c 20 additions, 5 deletionsblock/blk-mq-debugfs.c
- block/blk-mq-debugfs.h 0 additions, 5 deletionsblock/blk-mq-debugfs.h
- block/blk-mq-sched.c 11 additions, 0 deletionsblock/blk-mq-sched.c
- block/blk-rq-qos.c 2 additions, 0 deletionsblock/blk-rq-qos.c
- block/blk-rq-qos.h 6 additions, 1 deletionblock/blk-rq-qos.h
- block/blk-sysfs.c 9 additions, 11 deletionsblock/blk-sysfs.c
- include/linux/blkdev.h 4 additions, 4 deletionsinclude/linux/blkdev.h
- kernel/trace/blktrace.c 0 additions, 3 deletionskernel/trace/blktrace.c
Loading
Please register or sign in to comment