Skip to contentSkip to conversation

scsi: ibmvscsi_tgt: Remove target_wait_for_sess_cmd()

PATCH Applied Ly, Bryant 3 participants 3 messages Oct 16, 2018 – Oct 18, 2018

Subsystems (3)
lore
Share & tools
lore

Ly, Bryant

author
#0 lore raw

PATCH 1/1 scsi: ibmvscsi_tgt: Remove target_wait_for_sess_cmd()

From: "Bryant G. Ly" <[email protected]>

There is currently a bug with the driver where there is never a call to target_sess_cmd_list_set_waiting(), it only called target_wait_for_sess_cmd(), which basically means that the sess_wait_list would always be empty.

Thus, list_empty(&sess->sess_wait_list) = true,
(eg: no se_cmd I/O is quiesced, because no se_cmd in sess_wait_list), since commit 712db3eb2c35 ("scsi: ibmvscsis: Properly deregister target sessions") in 4.9.y code.

ibmvscsi_tgt does not remove the I_T Nexus when a VM is active so we can fix this issue by removing the call to target_wait_for_sess_cmd() altogether.

---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +0 -1
index fac3773..2175e9e 100644
@@ -2266,7 +2266,6 @@ static int ibmvscsis_drop_nexus(struct ibmvscsis_tport *tport)
 	/*
 	 * Release the SCSI I_T Nexus to the emulated ibmvscsis Target Port
 	 */
-	target_wait_for_sess_cmds(se_sess);
 	target_remove_session(se_sess);
 	tport->ibmv_nexus = NULL;
 	kfree(nexus);
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 27 lines · Bryant

From: "Bryant G. Ly" <[email protected]>

There is currently a bug with the driver where there is never a call to target_sess_cmd_list_set_waiting(), it only called target_wait_for_sess_cmd(), which basically means that the sess_wait_list would always be empty.

Thus, list_empty(&sess->sess_wait_list) = true,
(eg: no se_cmd I/O is quiesced, because no se_cmd in sess_wait_list), since commit 712db3eb2c35 ("scsi: ibmvscsis: Properly deregister target sessions") in 4.9.y code.

ibmvscsi_tgt does not remove the I_T Nexus when a VM is active so we can fix this issue by removing the call to target_wait_for_sess_cmd() altogether.

---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +0 -0
index fac3773..2175e9e 100644

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c static int ibmvscsis_drop_nexus(struct ibmvscsis_tport *tport) · line 2271

Quoted 7 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +0 -1
@@ -2266,7 +2266,6 @@ static int ibmvscsis_drop_nexus(struct ibmvscsis_tport *tport)
 	/*
 	 * Release the SCSI I_T Nexus to the emulated ibmvscsis Target Port
 	 */
-	target_wait_for_sess_cmds(se_sess);
 	target_remove_session(se_sess);
 	tport->ibmv_nexus = NULL;
 	kfree(nexus);
#2 lore raw
In reply to Ly, Bryant

Bryant,

Quoted 5 lines

There is currently a bug with the driver where there is never a call to target_sess_cmd_list_set_waiting(), it only called target_wait_for_sess_cmd(), which basically means that the sess_wait_list would always be empty.

Quoted 8 lines

Thus, list_empty(&sess->sess_wait_list) = true, (eg: no se_cmd I/O is quiesced, because no se_cmd in sess_wait_list), since commit 712db3eb2c35 ("scsi: ibmvscsis: Properly deregister target sessions") in 4.9.y code.

ibmvscsi_tgt does not remove the I_T Nexus when a VM is active so we can fix this issue by removing the call to target_wait_for_sess_cmd() altogether.

Applied to 4.20/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering