[dm-devel] [PATCH] multipath: fix set_oom_adj

Benjamin Marzinski bmarzins at redhat.com
Tue Jan 8 05:45:44 UTC 2013


Fix set_oom_adj() to work correclty if OOM_ADJUST_MIN isn't
defined.

Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
---
 multipathd/main.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: multipath-tools-120821/multipathd/main.c
===================================================================
--- multipath-tools-120821.orig/multipathd/main.c
+++ multipath-tools-120821/multipathd/main.c
@@ -1561,8 +1561,12 @@ set_oom_adj (void)
 				strerror(errno));
 			return;
 		}
+#ifdef OOM_ADJUST_MIN
 		file = "/proc/self/oom_adj";
 		score = OOM_ADJUST_MIN;
+#else
+		retry = 0;
+#endif
 	} while (retry--);
 	condlog(0, "couldn't adjust oom score");
 }




More information about the dm-devel mailing list