]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: iscsi: Flush block work before unblock
authorMike Christie <michael.christie@oracle.com>
Tue, 25 May 2021 18:18:09 +0000 (13:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 15:00:17 +0000 (17:00 +0200)
commit3bc02a09dfdcbb523fa3a88df2a8d583729613be
treee855560594add2811af49fe61ad29ee9aeb28801
parent99ddaeb4acb6c4b818ee937331800a9f867b9731
scsi: iscsi: Flush block work before unblock

[ Upstream commit 7ce9fc5ecde0d8bd64c29baee6c5e3ce7074ec9a ]

We set the max_active iSCSI EH works to 1, so all work is going to execute
in order by default. However, userspace can now override this in sysfs. If
max_active > 1, we can end up with the block_work on CPU1 and
iscsi_unblock_session running the unblock_work on CPU2 and the session and
target/device state will end up out of sync with each other.

This adds a flush of the block_work in iscsi_unblock_session.

Link: https://lore.kernel.org/r/20210525181821.7617-17-michael.christie@oracle.com
Fixes: 1d726aa6ef57 ("scsi: iscsi: Optimize work queue flush use")
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_transport_iscsi.c