Skip to content

Commit 7ce9fc5

Browse files
mikechristiemartinkpetersen
authored andcommitted
scsi: iscsi: Flush block work before unblock
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: 1d726aa ("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>
1 parent f6f9645 commit 7ce9fc5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/scsi/scsi_transport_iscsi.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,8 @@ static void __iscsi_unblock_session(struct work_struct *work)
19691969
*/
19701970
void iscsi_unblock_session(struct iscsi_cls_session *session)
19711971
{
1972+
flush_work(&session->block_work);
1973+
19721974
queue_work(iscsi_eh_timer_workq, &session->unblock_work);
19731975
/*
19741976
* Blocking the session can be done from any context so we only

0 commit comments

Comments
 (0)