]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xsigo: Compute node crash on FC failover
authorPradeep Gopanapalli <pradeep.gopanapalli@oracle.com>
Mon, 24 Apr 2017 20:37:10 +0000 (13:37 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 06:06:56 +0000 (23:06 -0700)
Orabug: 25981973

xsvhba's internally generated scsi command timeout code prematurely completes
a command rather than relying on qlogic to complete with "CMD_TIMEOUT" code.
Actual command completes just after xsigo timeout completion and
causes the freed buffer to be overwritten with inquiry data.
These code changes will allow scsi mid layer to do the recovery.
The original xsigo timeout code is not there in ESX xsvhba source code and was
mistakenly brought over in uek.

Reviewed-by: sajid.zia@oracle.com
Signed-off-by: Pradeep Gopanapalli <pradeep.gopanapalli@oracle.com>
Signed-off-by: said.zia@oracle.com
drivers/infiniband/ulp/xsigo/xsvhba/vhba_scsi_intf.c

index 1197388180992a9205f600af87222f0c3fb95ac3..fac4dabeb6aff2cd459ca263d325fd3d72aa16b8 100644 (file)
@@ -67,37 +67,6 @@ static int xg_vhba_slave_configure(struct scsi_device *device)
        return 0;
 }
 
-void xsigo_cmd_timeout(struct srb *sp)
-{
-       struct scsi_xg_vhba_host *ha;
-       struct scsi_cmnd *cmd;
-       struct virtual_hba *vhba;
-       int iocb_handle;
-       unsigned long flags = 0;
-
-       cmd = sp->cmd;
-       ha = sp->ha;
-       vhba = ha->vhba;
-
-       dprintk(TRC_SCSI_ERRS, vhba, "I/O timeout\n");
-
-       spin_lock_irqsave(&ha->io_lock, flags);
-
-       atomic_dec(&ha->stats.io_stats.num_vh_q_reqs[sp->queue_num]);
-
-       cmd->result = DID_ABORT << 16;
-       iocb_handle = sp->iocb_handle;
-       if (ha->outstanding_cmds[iocb_handle]) {
-               ha->outstanding_cmds[iocb_handle] = NULL;
-               CMD_SP(sp->cmd) = NULL;
-               spin_unlock_irqrestore(&ha->io_lock, flags);
-               complete_cmd_and_callback(vhba, sp, sp->cmd);
-               DEC_REF_CNT(vhba);
-       } else {
-               spin_unlock_irqrestore(&ha->io_lock, flags);
-       }
-}
-
 static int xg_vhba_queuecommand_lck(struct scsi_cmnd *cmd,
                                    void (*fn)(struct scsi_cmnd *))
 {
@@ -437,12 +406,6 @@ no_lun_mask:
        else
                timeout_val = timeout_per_command(cmd) / HZ;
 
-       sp->timer.expires = jiffies + (timeout_val - IB_CMD_TIMEOUT_DELTA) * HZ;
-       init_timer(&sp->timer);
-       sp->timer.data = (unsigned long)sp;
-       sp->timer.function = (void (*)(unsigned long))xsigo_cmd_timeout;
-       add_timer(&sp->timer);
-
        /* Prepare the IOCB, the handle, build IOCB and fire it off */
        dprintk(TRC_IO, vhba,
                "calling start scsi for sp %p t %d l %d\n", sp, t, (u32) l);