[Cluster-devel] [PATCH] rgmanager: Fix short read handling while loading resource rules

Lon Hohberger <[email protected]>
Newsgroups com.redhat.cluster-devel
Message-ID <[email protected]>
If a short read occurs (maybe due to a race between the parent/child
processes in SMP systems?) while reading from the pipe while using
resource rules, we break the loop early even if there's more data to be
had at a later time.

It fixed the problem for the reporter.

-- Lon

Index: resrules.c
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/resrules.c,v
retrieving revision 1.16.2.9
diff -u -r1.16.2.9 resrules.c
--- resrules.c	18 Dec 2007 17:52:56 -0000	1.16.2.9
+++ resrules.c	30 Jan 2008 18:35:14 -0000
@@ -906,7 +906,7 @@
 		if (n == 0 && (!*length))
 			return 0;
 
-		if (n != sizeof(buf)) {
+		if (n == 0) {
 			done = 1;
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.