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