]> git.baikalelectronics.ru Git - kernel.git/commit
block: serialize all debugfs operations using q->debugfs_mutex
authorChristoph Hellwig <hch@lst.de>
Tue, 14 Jun 2022 07:48:25 +0000 (09:48 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 17 Jun 2022 13:31:05 +0000 (07:31 -0600)
commit31e80862603fec925413dc8d8b37de3b39f8810c
treec6d3d7b1806f35e8fff9c439285324c6feeddad5
parent85ec4e33544542af4a7642f60f9fd2d147653888
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>
block/blk-mq-debugfs.c
block/blk-mq-debugfs.h
block/blk-mq-sched.c
block/blk-rq-qos.c
block/blk-rq-qos.h
block/blk-sysfs.c
include/linux/blkdev.h
kernel/trace/blktrace.c