From 6abf17b709d0169e0084b7b7c5cedb11b0f5c7a3 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Mon, 10 Mar 2003 21:30:03 +0000
Subject: [PATCH] Fix bug in handling explicit node list with no maximum node
 count.

---
 src/slurmctld/node_scheduler.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 3978d50b8c7..b86c90a53f7 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -534,7 +534,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 			total_nodes = bit_set_count(*req_bitmap);
 		if (req_cpus != 0)
 			total_cpus = count_cpus(*req_bitmap);
-		if (total_nodes > max_nodes) {
+		if ((max_nodes != 0) &&
+		    (total_nodes > max_nodes)) {
 			info("_pick_best_nodes: required nodes exceed limit");
 			return EINVAL;
 		}
-- 
GitLab