From 46348f917746df773b6941c20e46ec54e1fd1a6a Mon Sep 17 00:00:00 2001
From: Don Lipari <lipari1@llnl.gov>
Date: Thu, 14 Mar 2013 14:54:39 -0700
Subject: [PATCH] Record updated job time limit if modified by backfill

Without this change, if the job's time limit is modified down
toward --time-min by the backfill scheduler, update the job's
time limit in the database.
---
 src/plugins/sched/backfill/backfill.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c
index 38cb4b77dd9..18915499969 100644
--- a/src/plugins/sched/backfill/backfill.c
+++ b/src/plugins/sched/backfill/backfill.c
@@ -64,6 +64,7 @@
 #include "src/common/macros.h"
 #include "src/common/node_select.h"
 #include "src/common/parse_time.h"
+#include "src/common/slurm_accounting_storage.h"
 #include "src/common/slurm_protocol_api.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
@@ -875,7 +876,11 @@ static int _attempt_backfill(void)
 				job_ptr->start_time = 0;
 				break;
 			} else {
-				/* Started this job, move to next one */
+				/* Started this job. Update the database if job
+				 * time limit changed and move to next job */
+				if (orig_time_limit != job_ptr->time_limit)
+					jobacct_storage_g_job_start(acct_db_conn,
+								    job_ptr);
 				continue;
 			}
 		} else
-- 
GitLab