[SCSI] libfc: Check if exchange is completed when receiving a sequence
authorSteve Ma <steve.ma@intel.com>
Wed, 6 May 2009 17:52:29 +0000 (10:52 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 8 Jun 2009 18:29:11 +0000 (13:29 -0500)
When a sequence is received in response to an exchange we issued previously,
we should check to see if the exchange has completed. If yes, the sequence
should be discarded. Since the exchange might be still in the completion
process, it should be untouched.

Signed-off-by: Steve Ma <steve.ma@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/libfc/fc_exch.c

index 992af05aacf154f8ee4cbb5ea663fbb22611f5e6..7af9bceb8aa9efa467c3ca58ed4da1694ec7d79c 100644 (file)
@@ -1159,6 +1159,10 @@ static void fc_exch_recv_seq_resp(struct fc_exch_mgr *mp, struct fc_frame *fp)
                atomic_inc(&mp->stats.xid_not_found);
                goto out;
        }
+       if (ep->esb_stat & ESB_ST_COMPLETE) {
+               atomic_inc(&mp->stats.xid_not_found);
+               goto out;
+       }
        if (ep->rxid == FC_XID_UNKNOWN)
                ep->rxid = ntohs(fh->fh_rx_id);
        if (ep->sid != 0 && ep->sid != ntoh24(fh->fh_d_id)) {