|
From: Ross S. W. W. <RW...@me...> - 2010-06-29 21:31:17
|
IET 1.4.20 introduced a bug where deleting targets with sessions
via ietadm caused ietd to quit in error.
Current code base can't handle deleting targets with sessions, so
this patch just logs a warning message that the target is busy
instead.
Signed-off-by: Ross Walker
Index: usr/event.c
===================================================================
--- usr/event.c (revision 339)
+++ usr/event.c (working copy)
@@ -92,11 +92,11 @@ retry:
goto retry;
}
- if (!--session->conn_cnt)
+ if (--session->conn_cnt <= 0)
session_remove(session);
break;
default:
- log_warning("%s(%d) %u\n", __FUNCTION__, __LINE__, event.state);
+ log_error("%s(%d) %u\n", __FUNCTION__, __LINE__, event.state);
exit(-1);
break;
}
Index: usr/ietd.c
===================================================================
--- usr/ietd.c (revision 339)
+++ usr/ietd.c (working copy)
@@ -424,7 +424,7 @@ void event_loop(int timeout)
pollfd->fd = -1;
incoming[i] = NULL;
incoming_cnt--;
- if (session && !session->conn_cnt)
+ if (session && session->conn_cnt <= 0)
session_remove(session);
}
}
Index: usr/target.c
===================================================================
--- usr/target.c (revision 339)
+++ usr/target.c (working copy)
@@ -226,6 +226,12 @@ int target_del(u32 tid)
if (!target)
return -ENOENT;
+ if (!list_empty(&target->sessions_list)) {
+ log_warning("%s: target %u still has sessions\n", __FUNCTION__,
+ tid);
+ return -EBUSY;
+ }
+
err = ki->target_destroy(tid);
if (err < 0) {
log_error("unable to delete target %u: %d", tid, errno);
@@ -234,12 +240,6 @@ int target_del(u32 tid)
remque(&target->tlist);
- if (!list_empty(&target->sessions_list)) {
- log_error("%s: target %u still has sessions\n", __FUNCTION__,
- tid);
- exit(-1);
- }
-
all_accounts_del(tid, AUTH_DIR_INCOMING);
all_accounts_del(tid, AUTH_DIR_OUTGOING);
______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.
|