Skip to content

Commit 89ed5fa

Browse files
shroffniaxboe
authored andcommitted
block: release q->elevator_lock in ioc_qos_write
The ioc_qos_write method acquires q->elevator_lock to protect updates to blk-wbt parameters. Once these updates are complete, the lock should be released before returning from ioc_qos_write. However, in one code path, the release of q->elevator_lock was mistakenly omitted, potentially leading to a lock leak. This commit fixes the issue by ensuring that q->elevator_lock is properly released in all return paths of ioc_qos_write. Fixes: 245618f ("block: protect wbt_lat_usec using q->elevator_lock") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Signed-off-by: Nilay Shroff <[email protected]> Reviewed-by: Ming Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 989bcd6 commit 89ed5fa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/blk-iocost.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,6 +3348,7 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input,
33483348
wbt_enable_default(disk);
33493349

33503350
blk_mq_unquiesce_queue(disk->queue);
3351+
mutex_unlock(&disk->queue->elevator_lock);
33513352
blk_mq_unfreeze_queue(disk->queue, memflags);
33523353

33533354
blkg_conf_exit(&ctx);

0 commit comments

Comments
 (0)