]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge pull request #31393 from jiahuizeng/int-range
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 1 Dec 2020 21:53:49 +0000 (16:53 -0500)
committerGitHub <noreply@github.com>
Tue, 1 Dec 2020 21:53:49 +0000 (16:53 -0500)
rgw: avoid expiration early triggering caused by overflow

Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Abhishek Lekshmanan <abhishek@suse.com>
1  2 
src/rgw/rgw_lc.cc

index 26471a74642d91780d12b543c229852405461f19,be0b642a83da72ee799b5cb0cb7171c29f12ab99..7e5e2c2e5194dfa079884e4abf87b076eeb49631
@@@ -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);