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

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