[stgt] [PATCH 3/3] handle tx properly when iser connection is closing
Alexander Nezhinsky
alexandern at Voltaire.COM
Mon Jan 31 18:12:33 CET 2011
Removed ignoring tx when connection is in STATE_EXIT, which means that
we are going to close the connection because of a logical error
(presumably in login), but still have to send something.
Alternatively, when we close a connection asynchronously, iser_conn_close()
gets called, and sets the state to STATE_CLOSE. After that we really must
ignore any scheduled tx.
Related to that, in iser_login_tx_complete() we don't need to upgrade
STATE_EXIT to STATE_CLOSE, because STATE_CLOSE is supposed to be set only
from iser_conn_close().
Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
---
usr/iscsi/iser.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/usr/iscsi/iser.c b/usr/iscsi/iser.c
index 983a70f..3c81b54 100644
--- a/usr/iscsi/iser.c
+++ b/usr/iscsi/iser.c
@@ -2175,8 +2175,7 @@ static void iser_sched_tx(struct event_data *evt)
int num_reqs = 0;
int err;
- if (unlikely(conn->h.state == STATE_CLOSE ||
- conn->h.state == STATE_EXIT)) {
+ if (unlikely(conn->h.state == STATE_CLOSE)) {
dprintf("conn:%p closing, ignoring tx\n", conn);
return;
}
@@ -2805,9 +2804,6 @@ out:
static void iser_login_tx_complete(struct iser_conn *conn)
{
switch (conn->h.state) {
- case STATE_EXIT:
- conn->h.state = STATE_CLOSE;
- break;
case STATE_SECURITY_LOGIN:
conn->h.state = STATE_LOGIN;
break;
--
1.7.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