]> bbs.cooldavid.org Git - net-next-2.6.git/commit
[SCSI] libfc: Fix wrong scsi return status under FC_DATA_UNDRUN
authorYi Zou <yi.zou@intel.com>
Wed, 21 Oct 2009 23:27:12 +0000 (16:27 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 4 Dec 2009 18:00:27 +0000 (12:00 -0600)
commit4347fa66878e079766258bc0d077c350cb31a799
treefce5fee754b75169e6983914a077a1732932ad75
parentc340111dbb48482cd23f4e441deff9169be9bc6f
[SCSI] libfc: Fix wrong scsi return status under FC_DATA_UNDRUN

This bug is exposed when there is a link flap in LLD. Particularly, when it
happens right after a SCSI write command is sent out, no FCP_DATA is sent,
causing fsp->status_code to be set as FC_DATA_UNDRUN in fc_fcp_complete_locked
even no SCSI status is received. Consequently, fc_io_compl treats this as DID_OK.
This results in SCSI returning successful to the initial I/O request even
there is no DATA actually sent. Particularly, if you run an I/O tool w/ data
verification on, the read back for verification is gonna fail.

This is fixed here by checking when FC_DATA_UNDRUN happens, SCSI status is
received w/ FC_SRB_RCV_STATUS set in fsp->state.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_fcp.c