[Open-FCoE] [PATCH 3/3] libfc: removed FC_TYPE_FCP check in fc_exch_reset

Vasu Dev vasu.dev at intel.com
Wed Sep 17 01:03:59 UTC 2008

This check was preventing exch free. If fsp is aborted and BA_ACC
has been received, then FCP has already called exch_done while
also resetting seq_ptr in fsp. However exch_done from FCP will
not drop exch ref for exch in mp due to still pending RRQ.
At this point if fc_exch_reset occurs then exch will not get
freed due to pending exch ref for exch in mp. The fc_exch_reset
will clear the ESB_ST_REC_QUAL but will not call exch done again
due FC_TYPE_FCP check and ep->resp would be null in this case
since FCP has already called exch done.

So this patch made exch done unconditional in fc_exch_reset().

Signed-off-by: Vasu Dev <vasu.dev at intel.com>

 drivers/scsi/libfc/fc_exch.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 8fa45aa..ed74d95 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1507,9 +1507,7 @@ static void fc_exch_reset(struct fc_exch *ep)
 	ep->esb_stat &= ~ESB_ST_REC_QUAL;
 	arg = ep->arg;
 	sp = &ep->seq;
-	if (ep->fh_type != FC_TYPE_FCP)
-		rc = fc_exch_done_locked(ep);
+	rc = fc_exch_done_locked(ep);
 	if (!rc)

More information about the devel mailing list