[stgt] [PATCH 11/12] Handle conn_close_force gracefully

Chandra Seetharaman sekharan at us.ibm.com
Mon Sep 27 07:21:27 CEST 2010


Handle the conn_close() properly for forceful close of connection.

Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
Signed-off-by: Chandra Seetharaman <sekharan at us.ibm.com>

---
 usr/iscsi/conn.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: tgt-1.0.8.4/usr/iscsi/conn.c
===================================================================
--- tgt-1.0.8.4.orig/usr/iscsi/conn.c
+++ tgt-1.0.8.4/usr/iscsi/conn.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <errno.h>
 #include <sys/stat.h>
+#include <sys/epoll.h>
 
 #include "iscsid.h"
 #include "tgtd.h"
@@ -231,7 +232,9 @@ int conn_close_force(uint32_t tid, uint6
 			list_for_each_entry(conn, &session->conn_list, clist) {
 				if (conn->cid == cid) {
 					eprintf("close %" PRIx64 " %u\n", sid, cid);
-					conn_close(conn);
+					conn->state = STATE_CLOSE;
+					conn->tp->ep_event_modify(conn,
+						  EPOLLIN|EPOLLOUT|EPOLLERR);
 					return TGTADM_SUCCESS;
 				}
 			}
--
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