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

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