linux/drivers/scsi/fnic
Hiral Patel a0bf1ca27b [SCSI] fnic: fnic driver may hit BUG_ON on device reset
The issue was observed when LUN Reset is issued through IOCTL or sg_reset
utility.

fnic driver issues LUN RESET to firmware. On successful completion of device
reset, driver cleans up all the pending IOs that were issued prior to device
reset. These pending IOs are expected to be in ABTS_PENDING state. This works
fine, when the device reset operation resulted from midlayer, but not when
device reset was triggered from IOCTL path as the pending IOs were not in
ABTS_PENDING state. execution path hits panic if the pending IO is not in
ABTS_PENDING state.

Changes:
The fix replaces BUG_ON check in fnic_clean_pending_aborts() with marking
pending IOs as ABTS_PENDING if they were not in ABTS_PENDING state and skips
if they were already in ABTS_PENDING state. An extra check is added to validate
the abort status of the commands after a delay of 2 * E_D_TOV using a
helper function. The helper function returns 1 if it finds any pending IO in
ABTS_PENDING state, belong to the LUN on which device reset was issued else 0.
With this, device reset operation returns success only if the helper funciton
returns 0, otherwise it returns failure.

Other changes:
- Removed code in fnic_clean_pending_aborts() that returns failure if it finds
  io_req NULL, instead of returning failure added code to continue with next io
- Added device reset flags for debugging in fnic_terminate_rport_io,
  fnic_rport_exch_reset, and fnic_clean_pending_aborts

Signed-off-by: Narsimhulu Musini <nmusini@cisco.com>
Signed-off-by: Hiral Patel <hiralpat@cisco.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 17:30:19 +00:00
..
cq_desc.h
cq_enet_desc.h
cq_exch_desc.h
fcpio.h
fnic_attrs.c
fnic_fcs.c [SCSI] fnic: fix for trusted cos 2013-01-29 14:00:04 +11:00
fnic_io.h [SCSI] fnic: Fix SGEs limit 2013-02-22 17:29:35 +00:00
fnic_isr.c
fnic_main.c [SCSI] fnic: fixing issues in device and firmware reset code 2013-02-22 17:28:19 +00:00
fnic_res.c [SCSI] fnic: Add FIP support to the fnic driver 2009-12-04 12:01:19 -06:00
fnic_res.h [SCSI] fnic: Add FIP support to the fnic driver 2009-12-04 12:01:19 -06:00
fnic_scsi.c [SCSI] fnic: fnic driver may hit BUG_ON on device reset 2013-02-22 17:30:19 +00:00
fnic.h [SCSI] fnic: fnic driver may hit BUG_ON on device reset 2013-02-22 17:30:19 +00:00
Makefile
rq_enet_desc.h
vnic_cq_copy.h
vnic_cq.c
vnic_cq.h
vnic_dev.c [SCSI] fnic: fix memory leak 2011-02-12 10:58:02 -06:00
vnic_dev.h
vnic_devcmd.h [SCSI] fnic: Allow multicast and unicast address registrations for fnic 2010-02-17 17:43:49 -06:00
vnic_intr.c
vnic_intr.h
vnic_nic.h
vnic_resource.h
vnic_rq.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vnic_rq.h
vnic_scsi.h [SCSI] fnic: Add FIP support to the fnic driver 2009-12-04 12:01:19 -06:00
vnic_stats.h
vnic_wq_copy.c
vnic_wq_copy.h
vnic_wq.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vnic_wq.h
wq_enet_desc.h