Skip to contentSkip to conversation

rgmanager: Fix short read handling while loading resource rules

PATCH New Lon Hohberger 1 participant 1 message Jan 30, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rgmanager: Fix short read handling while loading resource rules

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

resrules.c +1 -1
diff -u -r1.16.2.9 resrules.c
@@ -906,7 +906,7 @@
 		if (n == 0 && (!*length))
 			return 0;
 
-		if (n != sizeof(buf)) {
+		if (n == 0) {
 			done = 1;
 		}