From 9bfc3f095d14abd4f4689d0b36622bc13a395e84 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 16 Oct 2011 13:58:07 +1100 Subject: [PATCH] Logout processing is a bit broken since it does not update the cmdsn properly Copy the code to initialize the cmdsn and expstatsn from nop.c --- lib/login.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/login.c b/lib/login.c index 24348e8..dd3beb4 100644 --- a/lib/login.c +++ b/lib/login.c @@ -1139,6 +1139,12 @@ iscsi_logout_async(struct iscsi_context *iscsi, iscsi_command_cb cb, /* flags : close the session */ iscsi_pdu_set_pduflags(pdu, 0x80); + /* cmdsn is not increased if Immediate delivery*/ + iscsi_pdu_set_cmdsn(pdu, iscsi->cmdsn); + pdu->cmdsn = iscsi->cmdsn; + + /* exp statsn */ + iscsi_pdu_set_expstatsn(pdu, iscsi->statsn+1); pdu->callback = cb; pdu->private_data = private_data;