Skip to content

Commit a8daaad

Browse files
author
Ming Lei
committed
block: release q->elevator_lock in ioc_qos_write
JIRA: https://issues.redhat.com/browse/RHEL-112997 commit 89ed5fa Author: Nilay Shroff <nilay@linux.ibm.com> Date: Wed Mar 19 16:23:45 2025 +0530 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 <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202503171650.cc082b66-lkp@intel.com Signed-off-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20250319105518.468941-2-nilay@linux.ibm.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent 0c1dcc1 commit a8daaad

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)