[PATCH 11/12] Handle conn_close_force gracefully

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>

---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux