Skip to content

Commit 1233751

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Nilay Shroff <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent f3dec61 commit 1233751

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
@@ -592,12 +592,9 @@ static ssize_t max_sectors_store(struct device *dev, struct device_attribute *at
592592
if (sscanf(buf, "%hu", &ms) <= 0)
593593
return -EINVAL;
594594

595-
blk_mq_freeze_queue(sdev->request_queue);
596595
lim = queue_limits_start_update(sdev->request_queue);
597596
lim.max_hw_sectors = ms;
598-
ret = queue_limits_commit_update(sdev->request_queue, &lim);
599-
blk_mq_unfreeze_queue(sdev->request_queue);
600-
597+
ret = queue_limits_commit_update_frozen(sdev->request_queue, &lim);
601598
if (ret)
602599
return ret;
603600
return count;

0 commit comments

Comments
 (0)