[SCSI] libiscsi: handle init task failures.
authorMike Christie <michaelc@cs.wisc.edu>
Tue, 2 Dec 2008 06:32:15 +0000 (00:32 -0600)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 29 Dec 2008 17:24:23 +0000 (11:24 -0600)
Mgmt setup used to not fail so we did not have to check
the return value. Now with cxgb3i it can so this has us
pass up a error.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/libiscsi.c

index ddf53978f0bef79a96ba9bed54801e3b68a44766..7225b6e2029e53e8f57e42078cbef77865bbe1a1 100644 (file)
@@ -475,8 +475,8 @@ static int iscsi_prep_mgmt_task(struct iscsi_conn *conn,
                }
        }
 
-       if (session->tt->init_task)
-               session->tt->init_task(task);
+       if (session->tt->init_task && session->tt->init_task(task))
+               return -EIO;
 
        if ((hdr->opcode & ISCSI_OPCODE_MASK) == ISCSI_OP_LOGOUT)
                session->state = ISCSI_STATE_LOGGING_OUT;