Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 May 2012 17:02:34 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r235019 - projects/iscsi_opt/sys/dev/iscsi/initiator
Message-ID:  <201205041702.q44H2YHY013763@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Fri May  4 17:02:34 2012
New Revision: 235019
URL: http://svn.freebsd.org/changeset/base/235019

Log:
  queue freeze count may not be zero initially

Modified:
  projects/iscsi_opt/sys/dev/iscsi/initiator/isc_cam.c

Modified: projects/iscsi_opt/sys/dev/iscsi/initiator/isc_cam.c
==============================================================================
--- projects/iscsi_opt/sys/dev/iscsi/initiator/isc_cam.c	Fri May  4 16:53:43 2012	(r235018)
+++ projects/iscsi_opt/sys/dev/iscsi/initiator/isc_cam.c	Fri May  4 17:02:34 2012	(r235019)
@@ -251,14 +251,14 @@ ic_action(struct cam_sim *sim, union ccb
 
 	  if (rc == EWOULDBLOCK) {
 		  if ((sp->cam_flags & ISC_QFROZEN) == 0) {
-			  xpt_freeze_simq(sim, 1);
+			  int freeze_count = xpt_freeze_simq(sim, 1);
 			  sp->cam_flags |= ISC_QFROZEN;
 			  CAM_UNLOCK(sp);
 			  SOCKBUF_LOCK(&sp->soc->so_snd);
 			  CAM_LOCK(sp);
-			  if (sp->cam_sim->devq->send_queue.qfrozen_cnt[0] != 1) {
-				  printf("lost race when acquiring socket buffer lock qfrozen_cnt=%d\n", sp->cam_sim->devq->send_queue.qfrozen_cnt[0]);
-				  sp->cam_sim->devq->send_queue.qfrozen_cnt[0] = 1;
+			  if (sp->cam_sim->devq->send_queue.qfrozen_cnt[0] != freeze_count) {
+			    printf("lost race when acquiring socket buffer lock qfrozen_cnt=%d freeze_count=%d\n", sp->cam_sim->devq->send_queue.qfrozen_cnt[0], freeze_count);
+				  sp->cam_sim->devq->send_queue.qfrozen_cnt[0] = freeze_count;
 			  }
 			  soupcall_set(sp->soc, SO_SND, isc_so_snd_upcall, sp);
 			  SOCKBUF_UNLOCK(&sp->soc->so_snd);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205041702.q44H2YHY013763>