Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/dev/iscsi Pull up following revision(s) (requested by...



details:   https://anonhg.NetBSD.org/src/rev/d07e4738ae22
branches:  netbsd-6
changeset: 774206:d07e4738ae22
user:      riz <riz%NetBSD.org@localhost>
date:      Tue Jun 12 19:41:25 2012 +0000

description:
Pull up following revision(s) (requested by mhitch in ticket #323):
        sys/dev/iscsi/iscsi_send.c: revision 1.2
        sys/dev/iscsi/iscsi_rcv.c: revision 1.2
Fix system freeze when trying to write to a raw iSCSI device with MAXPHYS
bytes.  Newfs does large writes when initializing the filesystem.
First, don't copy the head of a TAILQ to make a copy - the first entry will
still point back to the original head.  This caused the ccb list to link to
itself, resulting in a continous loop processing the same ccb and blocked
interrupts.  Use TAILQ_CONCAT() to copy the list.
Next, the ccb disposition was not set in the ccb when the ccb was throttled,
losing the CCBDISP_SCSIPI, so when a throttled ccb was resent, it failed to
call scscipi_done(), and left that I/O hanging.
I am now able to newfs an iSCSI device, was well as issued large writes
using dd.

diffstat:

 sys/dev/iscsi/iscsi_rcv.c  |  6 +++---
 sys/dev/iscsi/iscsi_send.c |  4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r c37b3ef4f339 -r d07e4738ae22 sys/dev/iscsi/iscsi_rcv.c
--- a/sys/dev/iscsi/iscsi_rcv.c Tue Jun 12 19:39:49 2012 +0000
+++ b/sys/dev/iscsi/iscsi_rcv.c Tue Jun 12 19:41:25 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_rcv.c,v 1.1 2011/10/23 21:15:02 agc Exp $        */
+/*     $NetBSD: iscsi_rcv.c,v 1.1.8.1 2012/06/12 19:41:25 riz Exp $    */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1138,8 +1138,8 @@
                DEBC(conn, 1, ("Unthrottling - MaxCmdSN = %d\n", MaxCmdSN));
 
                CS_BEGIN;
-               waiting = sess->ccbs_throttled;
-               TAILQ_INIT(&sess->ccbs_throttled);
+               TAILQ_INIT(&waiting);
+               TAILQ_CONCAT(&waiting, &sess->ccbs_throttled, chain);
                CS_END;
                while ((req_ccb = TAILQ_FIRST(&waiting)) != NULL) {
                        TAILQ_REMOVE(&waiting, req_ccb, chain);
diff -r c37b3ef4f339 -r d07e4738ae22 sys/dev/iscsi/iscsi_send.c
--- a/sys/dev/iscsi/iscsi_send.c        Tue Jun 12 19:39:49 2012 +0000
+++ b/sys/dev/iscsi/iscsi_send.c        Tue Jun 12 19:41:25 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_send.c,v 1.1 2011/10/23 21:15:02 agc Exp $       */
+/*     $NetBSD: iscsi_send.c,v 1.1.8.1 2012/06/12 19:41:25 riz Exp $   */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1345,6 +1345,7 @@
                if (/*CONSTCOND*/ISCSI_TROTTLING_ENABLED &&
                    /*CONSTCOND*/ISCSI_SERVER_TRUSTED &&
                    !sn_a_le_b(sess->CmdSN, sess->MaxCmdSN)) {
+                       ccb->disp = disp;
                        TAILQ_INSERT_TAIL(&sess->ccbs_throttled, ccb, chain);
                        splx(s);
                        PDEBOUT(("Throttling S - CmdSN = %d, MaxCmdSN = %d\n",
@@ -1363,6 +1364,7 @@
                while (/*CONSTCOND*/ISCSI_TROTTLING_ENABLED &&
                       /*CONSTCOND*/ISCSI_SERVER_TRUSTED &&
                       !sn_a_le_b(sess->CmdSN, sess->MaxCmdSN)) {
+                       ccb->disp = disp;
                        ccb->flags |= CCBF_WAITING;
                        TAILQ_INSERT_TAIL(&sess->ccbs_throttled, ccb, chain);
                        PDEBOUT(("Throttling W - CmdSN = %d, MaxCmdSN = %d\n",



Home | Main Index | Thread Index | Old Index