[stgt] [PATCH] Fix cmd sequence numbering for login phase of discovery sessions

Arne Redlich arne.redlich at googlemail.com
Sun Mar 29 08:51:29 CEST 2009

For discovery sessions the Exp- and the MaxCmdSNs are not set appropriately
during login phase. This leads to e.g. the OpenSolaris initiator not being able to
successfully perform a SendTargets discovery.
This patch also increases the CmdSN window size to avoid an issue previously observed
with the AIX initiator vs. IET (not tested - cf. IET svn rev. 22).

Signed-off-by: Arne Redlich <arne.redlich at googlemail.com>
 usr/iscsi/iscsid.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
index bfaec87..c45eeb2 100644
--- a/usr/iscsi/iscsid.c
+++ b/usr/iscsi/iscsid.c
@@ -487,10 +487,12 @@ static void login_start(struct iscsi_connection *conn)
 		memcpy(conn->session_param, target->session_param,
-		conn->exp_cmd_sn = be32_to_cpu(req->cmdsn);
-		dprintf("exp_cmd_sn: %d,%d\n", conn->exp_cmd_sn, req->cmdsn);
-		conn->max_cmd_sn = conn->exp_cmd_sn;
+	conn->exp_cmd_sn = be32_to_cpu(req->cmdsn);
+	conn->max_cmd_sn = conn->exp_cmd_sn + 1;
+	dprintf("exp_cmd_sn: %d,%d\n", conn->exp_cmd_sn, req->cmdsn);
 	text_key_add(conn, "TargetPortalGroupTag", "1");

To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list