scsi: ibmvscsis: Properly deregister target sessions
authorBryant G. Ly <bryantly@linux.vnet.ibm.com>
Wed, 31 Aug 2016 16:28:59 +0000 (11:28 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 4 Sep 2016 05:28:05 +0000 (01:28 -0400)
The driver currently doesn't properly deregisters target sessions
completely, so this will address that.

Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

index 7e873a7..4cf37d4 100644 (file)
@@ -1934,6 +1934,8 @@ 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);
+       transport_deregister_session_configfs(se_sess);
        transport_deregister_session(se_sess);
        tport->ibmv_nexus = NULL;
        kfree(nexus);