Module Name:    src
Committed By:   bouyer
Date:           Mon Apr  9 15:58:52 UTC 2018

Modified Files:
        src/sys/dev/iscsi [netbsd-8]: iscsi_rcv.c iscsi_send.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #709):
        sys/dev/iscsi/iscsi_send.c: revision 1.37 via patch
        sys/dev/iscsi/iscsi_rcv.c: revision 1.25 via patch
Return temporary errors when the session is trying to recover the last
connection. The scsipi layer will retry.
Add sanity check.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/dev/iscsi/iscsi_rcv.c
cvs rdiff -u -r1.34.6.1 -r1.34.6.2 src/sys/dev/iscsi/iscsi_send.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/iscsi/iscsi_rcv.c
diff -u src/sys/dev/iscsi/iscsi_rcv.c:1.23 src/sys/dev/iscsi/iscsi_rcv.c:1.23.8.1
--- src/sys/dev/iscsi/iscsi_rcv.c:1.23	Sun Dec 25 06:55:28 2016
+++ src/sys/dev/iscsi/iscsi_rcv.c	Mon Apr  9 15:58:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_rcv.c,v 1.23 2016/12/25 06:55:28 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_rcv.c,v 1.23.8.1 2018/04/09 15:58:52 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -737,6 +737,11 @@ receive_command_response_pdu(connection_
 		return -1;
 	}
 
+	if (req_ccb->flags & CCBF_COMPLETE) {
+		DEBOUT(("Possibly duplicate command response (tagged as COMPLETE)\n"));
+		return -1;
+	}
+
 	if (req_ccb->pdu_waiting != NULL) {
 		ccb_timeout_start(req_ccb, COMMAND_TIMEOUT);
 		req_ccb->num_timeouts = 0;

Index: src/sys/dev/iscsi/iscsi_send.c
diff -u src/sys/dev/iscsi/iscsi_send.c:1.34.6.1 src/sys/dev/iscsi/iscsi_send.c:1.34.6.2
--- src/sys/dev/iscsi/iscsi_send.c:1.34.6.1	Thu Dec 21 19:17:43 2017
+++ src/sys/dev/iscsi/iscsi_send.c	Mon Apr  9 15:58:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_send.c,v 1.34.6.1 2017/12/21 19:17:43 snj Exp $	*/
+/*	$NetBSD: iscsi_send.c,v 1.34.6.2 2018/04/09 15:58:52 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1485,7 +1485,10 @@ send_run_xfer(session_t *session, struct
 	conn = assign_connection(session, waitok);
 
 	if (conn == NULL || conn->terminating || conn->state != ST_FULL_FEATURE) {
-		xs->error = XS_SELTIMEOUT;
+		if (session->terminating)
+			xs->error = XS_SELTIMEOUT;
+		else
+			xs->error = XS_BUSY;
 		DEBC(conn, 10, ("run_xfer on dead connection\n"));
 		scsipi_done(xs);
 		unref_session(session);

Reply via email to