[SCSI] Allow FC LLD to fast-fail scsi eh by introducing new eh return
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Wed, 24 Mar 2010 15:50:30 +0000 (16:50 +0100)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 11 Apr 2010 14:49:33 +0000 (09:49 -0500)
commit2f2eb58762b4dcddfe25c90800323765c1257eca
treef69788ac1afc0b7924a033cb82f33dbc55b6af1c
parent7794a5af67c672d44cfdbc7172a608b7542a66e3
[SCSI]  Allow FC LLD to fast-fail scsi eh by introducing new eh return

If the scsi eh is running and then a FC LLD calls
fc_remote_port_delete, the SCSI commands sent from the eh will fail.
To prevent this, a FC LLD can call fc_block_scsi_eh from the eh
callback, blocking the eh thread until the dev_loss_tmo fires or the
remote port is available again.

If (e.g. for a multipathing setup) the dev_loss_tmo is set to a very
large value, thus preventing the scsi device removal , the scsi eh can
block for a long time. For multipathing, the fast_io_fail_tmo is then
set to a low value to detect path problems sooner.

This patch introduces a new return code FAST_IO_FAIL. The function
fc_block_scsi_eh now returns FAST_IO_FAIL when the fast_io_fail_tmo
fires. This indicates that the LLD terminated all pending I/O requests
and there are no more pending SCSI commands for the scsi eh to wait
for. This return code can be passed back to the scsi eh to stop the
escalation and finish the recovery process for this device.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/scsi_error.c
drivers/scsi/scsi_transport_fc.c
include/scsi/scsi.h
include/scsi/scsi_transport_fc.h