diff options
| author | Jens Axboe <axboe@kernel.dk> | 2017-11-19 13:52:55 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2017-11-27 14:03:58 -0500 |
| commit | 2967acbb257a6a9bf912f4778b727e00972eac9b (patch) | |
| tree | be2c900c9cdf5616713f21b8bb3c2d4f34426fee | |
| parent | 6c4ca1e36cdc1a0a7a84797804b87920ccbebf51 (diff) | |
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: 1f2cac107c59 ("blktrace: fix unlocked access to init/start-stop/teardown")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | kernel/trace/blktrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index c5987d4c5f23..987d9a9ae283 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
| @@ -591,7 +591,7 @@ static int __blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | |||
| 591 | return ret; | 591 | return ret; |
| 592 | 592 | ||
| 593 | if (copy_to_user(arg, &buts, sizeof(buts))) { | 593 | if (copy_to_user(arg, &buts, sizeof(buts))) { |
| 594 | blk_trace_remove(q); | 594 | __blk_trace_remove(q); |
| 595 | return -EFAULT; | 595 | return -EFAULT; |
| 596 | } | 596 | } |
| 597 | return 0; | 597 | return 0; |
| @@ -637,7 +637,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name, | |||
| 637 | return ret; | 637 | return ret; |
| 638 | 638 | ||
| 639 | if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) { | 639 | if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) { |
| 640 | blk_trace_remove(q); | 640 | __blk_trace_remove(q); |
| 641 | return -EFAULT; | 641 | return -EFAULT; |
| 642 | } | 642 | } |
| 643 | 643 | ||
