Skip to content
Snippets Groups Projects
Commit 6591440c authored by Danny Auble's avatar Danny Auble
Browse files

Merge remote-tracking branch 'origin/slurm-14.03' into slurm-14.11

parents 4636a339 1bef5ee8
No related branches found
No related tags found
No related merge requests found
......@@ -393,6 +393,8 @@ documents those changes that are of interest to users and administrators.
-- Fix "squeue --start" to override SQUEUE_FORMAT env variable.
-- Restore GRES functionality with select/linear plugin. It was broken in
version 14.03.10.
-- Fix possible race condition when attempting to use QOS on a system running
accounting_storage/filetxt.
* Changes in Slurm 14.03.10
===========================
......
......@@ -1135,16 +1135,13 @@ static int _get_assoc_mgr_res_list(void *db_conn, int enforce)
static int _get_assoc_mgr_qos_list(void *db_conn, int enforce)
{
uid_t uid = getuid();
List new_list = NULL;
assoc_mgr_lock_t locks = { NO_LOCK, NO_LOCK,
WRITE_LOCK, NO_LOCK, NO_LOCK, NO_LOCK };
assoc_mgr_lock(&locks);
if (assoc_mgr_qos_list)
list_destroy(assoc_mgr_qos_list);
assoc_mgr_qos_list = acct_storage_g_get_qos(db_conn, uid, NULL);
new_list = acct_storage_g_get_qos(db_conn, uid, NULL);
if (!assoc_mgr_qos_list) {
assoc_mgr_unlock(&locks);
if (!new_list) {
if (enforce & ACCOUNTING_ENFORCE_ASSOCS) {
error("_get_assoc_mgr_qos_list: no list was made.");
return SLURM_ERROR;
......@@ -1153,9 +1150,16 @@ static int _get_assoc_mgr_qos_list(void *db_conn, int enforce)
}
}
assoc_mgr_lock(&locks);
FREE_NULL_LIST(assoc_mgr_qos_list);
assoc_mgr_qos_list = new_list;
new_list = NULL;
_post_qos_list(assoc_mgr_qos_list);
assoc_mgr_unlock(&locks);
return SLURM_SUCCESS;
}
......@@ -1843,13 +1847,21 @@ extern int assoc_mgr_fill_in_assoc(void *db_conn,
if (assoc_pptr)
*assoc_pptr = NULL;
/* Call assoc_mgr_refresh_lists instead of just getting the
association list because we need qos and user lists before
the association list can be made.
*/
if (!assoc_mgr_association_list)
if (assoc_mgr_refresh_lists(db_conn) == SLURM_ERROR)
return SLURM_ERROR;
/* Since we might be locked we can't come in here and try to
* get the list since we would need the WRITE_LOCK to do that,
* so just return as this would only happen on a system not
* talking to the database.
*/
if (!assoc_mgr_association_list) {
int rc = SLURM_SUCCESS;
if (enforce & ACCOUNTING_ENFORCE_QOS) {
error("No Association list available, "
"this should never happen");
rc = SLURM_ERROR;
}
return rc;
}
if ((!assoc_mgr_association_list
|| !list_count(assoc_mgr_association_list))
......@@ -2100,14 +2112,28 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, slurmdb_qos_rec_t *qos,
if (qos_pptr)
*qos_pptr = NULL;
if (!assoc_mgr_qos_list)
if (_get_assoc_mgr_qos_list(db_conn, enforce) == SLURM_ERROR)
return SLURM_ERROR;
if (!locked)
assoc_mgr_lock(&locks);
if ((!assoc_mgr_qos_list || !list_count(assoc_mgr_qos_list))
&& !(enforce & ACCOUNTING_ENFORCE_QOS)) {
/* Since we might be locked we can't come in here and try to
* get the list since we would need the WRITE_LOCK to do that,
* so just return as this would only happen on a system not
* talking to the database.
*/
if (!assoc_mgr_qos_list) {
int rc = SLURM_SUCCESS;
if (enforce & ACCOUNTING_ENFORCE_QOS) {
error("No QOS list available, "
"this should never happen");
rc = SLURM_ERROR;
}
if (!locked)
assoc_mgr_unlock(&locks);
return rc;
} else if (!list_count(assoc_mgr_qos_list)
&& !(enforce & ACCOUNTING_ENFORCE_QOS)) {
if (!locked)
assoc_mgr_unlock(&locks);
return SLURM_SUCCESS;
......
......@@ -595,6 +595,16 @@ extern void qos_list_build(char *qos, bitstr_t **qos_bits)
/* Lock here to avoid g_qos_count changing under us */
assoc_mgr_lock(&locks);
if (!g_qos_count) {
error("We have no QOS on the system Ignoring invalid "
"Allow/DenyQOS value(s) %s",
qos);
assoc_mgr_unlock(&locks);
FREE_NULL_BITMAP(*qos_bits);
*qos_bits = NULL;
return;
}
tmp_qos_bitstr = bit_alloc(g_qos_count);
tmp_qos = xstrdup(qos);
one_qos_name = strtok_r(tmp_qos, ",", &name_ptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment