From adf7cfe2a59f7a462e66c70cb1e0061d361ef90f Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Tue, 13 May 2008 18:48:57 +0000
Subject: [PATCH] Fix bug in processing job feature requests with node counts
 (could fail     to schedule job if some nodes have not associated features).

---
 NEWS                           | 2 ++
 src/slurmctld/node_scheduler.c | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 53fdf4a58a6..6f89865d563 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,8 @@ documents those changes that are of interest to users and admins.
     management yet.
  -- For srun/sbatch --get-user-env option (Moab use only) look for "env"
     command in both /bin and /usr/sbin (for Suse Linux).
+ -- Fix bug in processing job feature requests with node counts (could fail
+    to schedule job if some nodes have not associated features).
 
 * Changes in SLURM 1.3.1
 ========================
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 366f308be43..d6ea15e892d 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -233,7 +233,7 @@ static int _match_feature(char *seek, char *available)
 	if (seek == NULL)
 		return 1;	/* nothing to look for */
 	if (available == NULL)
-		return SLURM_SUCCESS;	/* nothing to find */
+		return 0;	/* nothing to find */
 
 	tmp_available = xstrdup(available);
 	found = 0;
@@ -1636,8 +1636,6 @@ static bitstr_t *_valid_features(struct job_details *details_ptr,
 		bit_set(result_bits, 0);
 		return result_bits;
 	}
-	if (available == NULL)			/* no features */
-		return result_bits;
 
 	result = 1;				/* assume good for now */
 	last_op = FEATURE_OP_AND;
-- 
GitLab