Skip to content

Commit 2967acb

Browse files
committed
blktrace: fix trace mutex deadlock
A previous commit changed the locking around registration/cleanup, but direct callers of blk_trace_remove() were missed. This means that if we hit the error path in setup, we will deadlock on attempting to re-acquire the queue trace mutex. Fixes: 1f2cac1 ("blktrace: fix unlocked access to init/start-stop/teardown") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6c4ca1e commit 2967acb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/blktrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static int __blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
591591
return ret;
592592

593593
if (copy_to_user(arg, &buts, sizeof(buts))) {
594-
blk_trace_remove(q);
594+
__blk_trace_remove(q);
595595
return -EFAULT;
596596
}
597597
return 0;
@@ -637,7 +637,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
637637
return ret;
638638

639639
if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
640-
blk_trace_remove(q);
640+
__blk_trace_remove(q);
641641
return -EFAULT;
642642
}
643643

0 commit comments

Comments
 (0)