]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: iscsi: Fix recovery and unblocking race
authorMike Christie <michael.christie@oracle.com>
Sat, 26 Feb 2022 23:04:30 +0000 (17:04 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 2 Mar 2022 04:56:28 +0000 (23:56 -0500)
commitc997e80de2d6e9457e5a93a20b54090c733b6aed
treea04a8f4bbef02f92fb4a54c0a097ee025149c8fb
parentd98b23d0e61220e3d4764af0f26914af1ae876e4
scsi: iscsi: Fix recovery and unblocking race

If the user sets the iscsi_eh_timer_workq/iscsi_eh workqueue's max_active
to greater than 1, the recovery_work could be running when
__iscsi_unblock_session() runs. The cancel_delayed_work() will then not
wait for the running work and we can race where we end up with the wrong
session state and scsi_device state set.

This replaces the cancel_delayed_work() with the sync version.

Link: https://lore.kernel.org/r/20220226230435.38733-2-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Chris Leech <cleech@redhat.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_iscsi.c