blktrace: don't centralize grabbing q->debugfs_mutex in blk_trace_ioctl
JIRA: https://issues.redhat.com/browse/RHEL-79409 commit fd9b0244f5c5f63461ca9752eebd2423ae02bb59 Author: Ming Lei <ming.lei@redhat.com> Date: Thu Nov 28 20:50:26 2024 +0800 blktrace: don't centralize grabbing q->debugfs_mutex in blk_trace_ioctl Call each handler directly and the handler do grab q->debugfs_mutex, prepare for killing dependency between ->debug_mutex and ->mmap_lock. Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20241128125029.4152292-2-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <ming.lei@redhat.com>
This commit is contained in:
parent
a5eb89608e
commit
38b144a09a
|
@ -733,34 +733,32 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
|
|||
int ret, start = 0;
|
||||
char b[BDEVNAME_SIZE];
|
||||
|
||||
mutex_lock(&q->debugfs_mutex);
|
||||
|
||||
switch (cmd) {
|
||||
case BLKTRACESETUP:
|
||||
snprintf(b, sizeof(b), "%pg", bdev);
|
||||
ret = __blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
|
||||
ret = blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
|
||||
break;
|
||||
#if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
|
||||
case BLKTRACESETUP32:
|
||||
snprintf(b, sizeof(b), "%pg", bdev);
|
||||
mutex_lock(&q->debugfs_mutex);
|
||||
ret = compat_blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
|
||||
mutex_unlock(&q->debugfs_mutex);
|
||||
break;
|
||||
#endif
|
||||
case BLKTRACESTART:
|
||||
start = 1;
|
||||
fallthrough;
|
||||
case BLKTRACESTOP:
|
||||
ret = __blk_trace_startstop(q, start);
|
||||
ret = blk_trace_startstop(q, start);
|
||||
break;
|
||||
case BLKTRACETEARDOWN:
|
||||
ret = __blk_trace_remove(q);
|
||||
ret = blk_trace_remove(q);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
mutex_unlock(&q->debugfs_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue