Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f62edba authored by Jens Axboe's avatar Jens Axboe Committed by Greg Kroah-Hartman
Browse files

blktrace: fix trace mutex deadlock



commit 2967acbb257a6a9bf912f4778b727e00972eac9b upstream.

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: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0ef5b092
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ static int __blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
		return ret;

	if (copy_to_user(arg, &buts, sizeof(buts))) {
		blk_trace_remove(q);
		__blk_trace_remove(q);
		return -EFAULT;
	}
	return 0;
@@ -618,7 +618,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
		return ret;

	if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
		blk_trace_remove(q);
		__blk_trace_remove(q);
		return -EFAULT;
	}