]> www.infradead.org Git - nvme.git/commit
blktrace: move copy_[to|from]_user() out of ->debugfs_lock
authorMing Lei <ming.lei@redhat.com>
Thu, 28 Nov 2024 12:50:27 +0000 (20:50 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Dec 2024 15:17:22 +0000 (08:17 -0700)
commitb769a2f409e7a356db852a1bb62a32f7809b3a3c
tree64aaafe37cdaf90e068972f1d765fe09acaca1a1
parentfd9b0244f5c5f63461ca9752eebd2423ae02bb59
blktrace: move copy_[to|from]_user() out of ->debugfs_lock

Move copy_[to|from]_user() out of ->debugfs_lock and cut the dependency
between mm->mmap_lock and q->debugfs_lock, then we avoids lots of
lockdep false positive warning. Obviously ->debug_lock isn't needed
for copy_[to|from]_user().

The only behavior change is to call blk_trace_remove() in case of setup
failure handling by re-grabbing ->debugfs_lock, and this way is just
fine since we do cover concurrent setup() & remove().

Reported-by: syzbot+91585b36b538053343e4@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-block/67450fd4.050a0220.1286eb.0007.GAE@google.com/
Closes: https://lore.kernel.org/linux-block/6742e584.050a0220.1cc393.0038.GAE@google.com/
Closes: https://lore.kernel.org/linux-block/6742a600.050a0220.1cc393.002e.GAE@google.com/
Closes: https://lore.kernel.org/linux-block/67420102.050a0220.1cc393.0019.GAE@google.com/
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241128125029.4152292-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
kernel/trace/blktrace.c