Skip to content

Commit 28526c3

Browse files
author
Ming Lei
committed
usb-storage: fix queue freeze vs limits lock order
JIRA: https://issues.redhat.com/browse/RHEL-71345 Upstream Status: for-6.4/block commit 1233751 Author: Christoph Hellwig <hch@lst.de> Date: Fri Jan 10 06:47:17 2025 +0100 usb-storage: fix queue freeze vs limits lock order Match the locking order used by the core block code by only freezing the queue after taking the limits lock using the queue_limits_commit_update_frozen helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20250110054726.1499538-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent 9fc5a8a commit 28526c3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/usb/storage/scsiglue.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,9 @@ static ssize_t max_sectors_store(struct device *dev, struct device_attribute *at
586586
if (sscanf(buf, "%hu", &ms) <= 0)
587587
return -EINVAL;
588588

589-
blk_mq_freeze_queue(sdev->request_queue);
590589
lim = queue_limits_start_update(sdev->request_queue);
591590
lim.max_hw_sectors = ms;
592-
ret = queue_limits_commit_update(sdev->request_queue, &lim);
593-
blk_mq_unfreeze_queue(sdev->request_queue);
594-
591+
ret = queue_limits_commit_update_frozen(sdev->request_queue, &lim);
595592
if (ret)
596593
return ret;
597594
return count;

0 commit comments

Comments
 (0)