Blame SOURCES/open-iscsi-2.0.874-iscsid-reset-head-on-wrap-when-buffer-empty.patch

ae92e4
From 2235c48bd993ead1d6e3de405b98b524d4bc0b61 Mon Sep 17 00:00:00 2001
ae92e4
From: Chris Leech <cleech@redhat.com>
ae92e4
Date: Tue, 28 Feb 2017 19:34:03 -0800
ae92e4
Subject: iscsid: reset head on wrap when buffer empty
ae92e4
ae92e4
Reported-By: David Jeffery <djeffery@redhat.com>
ae92e4
---
ae92e4
 usr/log.c | 3 +++
ae92e4
 1 file changed, 3 insertions(+)
ae92e4
ae92e4
diff --git a/usr/log.c b/usr/log.c
ae92e4
index 26c61d847793..b730642779bf 100644
ae92e4
--- a/usr/log.c
ae92e4
+++ b/usr/log.c
ae92e4
@@ -189,6 +189,9 @@ int log_enqueue (int prio, const char * fmt, va_list ap)
ae92e4
 	    (len + sizeof(struct logmsg)) > (la->end - la->tail)) {
ae92e4
 		logdbg(stderr, "enqueue: rewind tail to %p\n", la->tail);
ae92e4
 			la->tail = la->start;
ae92e4
+
ae92e4
+			if (la->empty)
ae92e4
+				la->head = lastmsg = la->tail;
ae92e4
 	}
ae92e4
 
ae92e4
 	/* not enough space on head : drop msg */
ae92e4
-- 
ae92e4
2.9.3
ae92e4