• Yi Zou's avatar
    [SCSI] libfc: fix sending REC after FCP_RESP is received · a752359f
    Yi Zou authored
    This is exposed in the case the FCP_DATA frames somehow got lost and fc_fcp got
    the FCP_RSP, in fc_fcp_recv_resp(), since xfer_len is less than the expected_len
    it resets the the timer to wait to 2 more jiffies in case the data frames are
    already queued locally. However, for target does not support REC, it would just
    send RJT w/ ELS_RJT_UNSUP. The rec response handler thus only clears the rport
    flag for not doing REC later, but does not do fcp_io_complete() on the
    associated fsp.
    
    The fix is just check status of FCP_RSP being received already, i.e. using the
    FC_SRB_RCV_STATUS flag, in fc_fcp_timeout before start sending REC. We should
    have waited long enough if there is truely data frames queued locally.
    Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
    Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
    Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
    Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
    a752359f
fc_fcp.c 59.1 KB