scsi: scsi_debug: Protect block_unblock_all_queues() with mutex
authorJohn Garry <john.g.garry@oracle.com>
Mon, 27 Mar 2023 07:43:03 +0000 (07:43 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 3 Apr 2023 02:09:21 +0000 (22:09 -0400)
commit25b80b2c7582ea15ba90b8007f1e1f1b8fc762b9
treedfdf88c1c09d4ea972bbd3b3b10d6783ec91cfa0
parent0aaa3fad4fd931ba3accac3a1fcc7334ca780591
scsi: scsi_debug: Protect block_unblock_all_queues() with mutex

There is no reason that calls to block_unblock_all_queues() from different
context can't race with one another, so protect with the
sdebug_host_list_mutex. There's no need for a more fine-grained per shost
locking here (and we don't have a per-host lock anyway).

Also simplify some touched code in sdebug_change_qdepth().

Signed-off-by: John Garry <john.g.garry@oracle.com>
Link: https://lore.kernel.org/r/20230327074310.1862889-5-john.g.garry@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c