[SCSI] bnx2fc: call scsi_done if session goes to not ready from ready
authorNithin Nayak Sujir <nsujir@broadcom.com>
Mon, 25 Apr 2011 19:30:08 +0000 (12:30 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 1 May 2011 16:52:38 +0000 (11:52 -0500)
If the session is not ready yet, we ask the SCSI-ml to retry. However, if the
session is just uploaded, we should not retry, but instead call scsi_done to
fail the IO.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/bnx2fc/bnx2fc_io.c

index 1decefb..b5b5c34 100644 (file)
@@ -1663,6 +1663,12 @@ int bnx2fc_queuecommand(struct Scsi_Host *host,
        tgt = (struct bnx2fc_rport *)&rp[1];
 
        if (!test_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags)) {
+               if (test_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags))  {
+                       sc_cmd->result = DID_NO_CONNECT << 16;
+                       sc_cmd->scsi_done(sc_cmd);
+                       return 0;
+
+               }
                /*
                 * Session is not offloaded yet. Let SCSI-ml retry
                 * the command.