Commit e4cff23b authored by Leigh Stoller's avatar Leigh Stoller

Minor fix for node specific pre-reserve requests.

parent efdd2de0
......@@ -3721,10 +3721,31 @@ sub CheckPreReserve($$)
#
my $noderes_result =
DBQueryWarn("select node_id from node_reservations ".
"where node_id='$node_id' and pid='$pid'");
"where pid='$pid'");
goto done
if (!$noderes_result);
#
# Note that if there any entries in the node_reservations table,
# then only those specific nodes can fulfill the request. Search
# the list for the node_id we are freeing.
#
if ($noderes_result->numrows) {
my $okay = 0;
while (my ($id) = $noderes_result->fetchrow_array()) {
if ($node_id eq $id) {
$okay = 1;
last;
}
}
#
# XXX We should look for another reservation to fulfill.
#
goto done
if (!$okay);
}
if (DBQueryWarn("update nodes set reserved_pid='$pid' ".
"where node_id='$node_id'")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment