|
|
3f3ec35 |
From 36a8b41de43749d91dfd52f9c8ad4a454c9a8f15 Mon Sep 17 00:00:00 2001
|
|
|
3f3ec35 |
From: Mike Christie <michaelc@cs.wisc.edu>
|
|
|
3f3ec35 |
Date: Fri, 14 Mar 2014 01:41:29 -0500
|
|
|
3f3ec35 |
Subject: [PATCH] iscsid: Fix handling of iscsi async events.
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
When iscsi targets send 32 or more iscsi async event pdus the
|
|
|
3f3ec35 |
initiator will run out of memory for events and this message:
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
BUG: iscsid: Can not allocate memory for receive context.
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
will be logged non stop. iscsid will then not be able to
|
|
|
3f3ec35 |
complate any more requests because it is stuck in a endless loop
|
|
|
3f3ec35 |
printing that message.
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
This fixes the problem by having iscsid handle an event after it
|
|
|
3f3ec35 |
has read it in from netlink or the mgmt ipc. Previously we would
|
|
|
3f3ec35 |
queue all events then handle them.
|
|
|
3f3ec35 |
---
|
|
|
3f3ec35 |
usr/event_poll.c | 5 ++++-
|
|
|
3f3ec35 |
usr/netlink.c | 2 +-
|
|
|
3f3ec35 |
2 files changed, 5 insertions(+), 2 deletions(-)
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
diff --git a/usr/event_poll.c b/usr/event_poll.c
|
|
|
3f3ec35 |
index f36fec1..939f1a2 100644
|
|
|
3f3ec35 |
--- a/usr/event_poll.c
|
|
|
3f3ec35 |
+++ b/usr/event_poll.c
|
|
|
3f3ec35 |
@@ -165,8 +165,11 @@ void event_loop(struct iscsi_ipc *ipc, int control_fd, int mgmt_ipc_fd)
|
|
|
3f3ec35 |
"exiting", res, errno);
|
|
|
3f3ec35 |
break;
|
|
|
3f3ec35 |
}
|
|
|
3f3ec35 |
- } else
|
|
|
3f3ec35 |
+ }
|
|
|
3f3ec35 |
+
|
|
|
3f3ec35 |
+ if (res >= 0)
|
|
|
3f3ec35 |
actor_poll();
|
|
|
3f3ec35 |
+
|
|
|
3f3ec35 |
reap_proc();
|
|
|
3f3ec35 |
/*
|
|
|
3f3ec35 |
* flush sysfs cache since kernel objs may
|
|
|
3f3ec35 |
diff --git a/usr/netlink.c b/usr/netlink.c
|
|
|
3f3ec35 |
index 1c4b5cc..532d9ef 100644
|
|
|
3f3ec35 |
--- a/usr/netlink.c
|
|
|
3f3ec35 |
+++ b/usr/netlink.c
|
|
|
3f3ec35 |
@@ -1615,8 +1615,8 @@ static int ctldev_handle(void)
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
ev_context = ipc_ev_clbk->get_ev_context(conn, ev_size);
|
|
|
3f3ec35 |
if (!ev_context) {
|
|
|
3f3ec35 |
- /* retry later */
|
|
|
3f3ec35 |
log_error("Can not allocate memory for receive context.");
|
|
|
3f3ec35 |
+ drop_data(nlh);
|
|
|
3f3ec35 |
return -ENOMEM;
|
|
|
3f3ec35 |
}
|
|
|
3f3ec35 |
|
|
|
3f3ec35 |
--
|
|
|
3f3ec35 |
1.9.3
|
|
|
3f3ec35 |
|