From: Pradeep Gopanapalli Date: Mon, 24 Apr 2017 20:37:10 +0000 (-0700) Subject: xsigo: Compute node crash on FC failover X-Git-Tag: v4.1.12-102.0.20170601_1400~248 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=80050c8ee0554e310c6291b99b046eaa1e89f38a;p=users%2Fjedix%2Flinux-maple.git xsigo: Compute node crash on FC failover 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 Signed-off-by: said.zia@oracle.com --- diff --git a/drivers/infiniband/ulp/xsigo/xsvhba/vhba_scsi_intf.c b/drivers/infiniband/ulp/xsigo/xsvhba/vhba_scsi_intf.c index 1197388180992..fac4dabeb6aff 100644 --- a/drivers/infiniband/ulp/xsigo/xsvhba/vhba_scsi_intf.c +++ b/drivers/infiniband/ulp/xsigo/xsvhba/vhba_scsi_intf.c @@ -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);