From: J. Eric Ivancich Date: Tue, 1 Dec 2020 21:53:49 +0000 (-0500) Subject: Merge pull request #31393 from jiahuizeng/int-range X-Git-Tag: v17.0.0~455 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3d6b04a9bf55a25aba78a7db25c330c341a3e84f;p=ceph-ci.git Merge pull request #31393 from jiahuizeng/int-range rgw: avoid expiration early triggering caused by overflow Reviewed-by: Matt Benjamin Reviewed-by: Abhishek Lekshmanan --- 3d6b04a9bf55a25aba78a7db25c330c341a3e84f diff --cc src/rgw/rgw_lc.cc index 26471a74642,be0b642a83d..7e5e2c2e519 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@@ -348,11 -312,10 +348,11 @@@ static bool obj_has_expired(CephContex base_time = ceph_clock_now().round_to_day(); } else { /* We're in debug mode; Treat each rgw_lc_debug_interval seconds as a day */ - cmp = days*cct->_conf->rgw_lc_debug_interval; + cmp = double(days)*cct->_conf->rgw_lc_debug_interval; base_time = ceph_clock_now(); } - timediff = base_time - ceph::real_clock::to_time_t(mtime); + auto tt_mtime = ceph::real_clock::to_time_t(mtime); + timediff = base_time - tt_mtime; if (expire_time) { *expire_time = mtime + make_timespan(cmp);