From 36f0a0d9f16b8ba43a12bcfcedf41de877a31553 Mon Sep 17 00:00:00 2001 From: Morris Jette <jette@schedmd.com> Date: Mon, 9 Sep 2013 11:31:42 -0700 Subject: [PATCH] Add comment about job array data structures Try to avoid problems when the job record is changed. --- src/slurmctld/job_mgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 9104986c34b..0d2a2dd1ff0 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -2770,7 +2770,7 @@ extern void rehash_jobs(void) } } -/* Create an exact copy of an existing job record. +/* Create an exact copy of an existing job record for a job array. * Assumes the job has no resource allocaiton */ struct job_record *_job_rec_copy(struct job_record *job_ptr) { @@ -5645,6 +5645,10 @@ static void _list_delete_job(void *job_entry) fatal("job hash error"); *job_pptr = job_ptr->job_next; +/* + * NOTE: Anything you free here also needs to be allocated memory copied + * when a job array is created in _job_rec_copy() above + */ delete_job_details(job_ptr); xfree(job_ptr->account); xfree(job_ptr->alias_list); -- GitLab