diff --git a/NEWS b/NEWS index e5af5c2cf3e2cdf128dc61b30e0c315878df2d71..500ed9dee1342b786c124a759e9dcff0ab1321ea 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,8 @@ documents those changes that are of interest to users and admins. line. Previously the line could be shortened prematurely. -- BLUEGENE - Fix to make sure we don't erroneously set a connection type to SMALL. + -- Type cast a negative uint64_t to int64_t to avoid confusion when doing + arithmetic with it in accounting dealing with over commit time. * Changes in SLURM 2.0.8 ======================== diff --git a/src/plugins/accounting_storage/mysql/mysql_rollup.c b/src/plugins/accounting_storage/mysql/mysql_rollup.c index eadc0e1a348e120bfe68574f836510f62d2dbf81..ff3654b68f222f415b1c44c4ea6555f5355d5908 100644 --- a/src/plugins/accounting_storage/mysql/mysql_rollup.c +++ b/src/plugins/accounting_storage/mysql/mysql_rollup.c @@ -804,8 +804,8 @@ extern int mysql_hourly_rollup(mysql_conn_t *mysql_conn, if((int64_t)c_usage->i_cpu < 0) { /* info("got %d %d %d", c_usage->r_cpu, */ /* c_usage->i_cpu, c_usage->o_cpu); */ - c_usage->r_cpu += c_usage->i_cpu; - c_usage->o_cpu -= c_usage->i_cpu; + c_usage->r_cpu += (int64_t)c_usage->i_cpu; + c_usage->o_cpu -= (int64_t)c_usage->i_cpu; c_usage->i_cpu = 0; if((int64_t)c_usage->r_cpu < 0) c_usage->r_cpu = 0;