Bug #56993
openrgw_object_lock.cc:The maximum time of bucket object lock is 24855 days
0%
Description
ceph::real_time RGWObjectLock::get_lock_until_date(const ceph::real_time& mtime) const {
if (!rule_exist) {
return ceph::real_time();
}
//if days = 24855,days*60*60*24 will overflow
int days = get_days();
if (days <= 0) {
days = get_years()*365;
}
return mtime + make_timespan(days*24*60*60);
}
Maybe we can replace int with int64_t or uint64_t?
ceph::real_time RGWObjectLock::get_lock_until_date(const ceph::real_time& mtime) const {
if (!rule_exist) {
return ceph::real_time();
}
int64_t days = get_days();
if (days <= 0) {
days = get_years()*365;
}
return mtime + make_timespan(days*24*60*60);
}
like this?
Files
Updated by Casey Bodley over 1 year ago
- Tags set to object-lock low-hanging-fruit
thanks, would you be willing to prepare and test a fix?
Updated by yuxuan yang over 1 year ago
Casey Bodley wrote:
thanks, would you be willing to prepare and test a fix?
yes,I do a test on it.The overflow was resolved.And I found a new thing, when the retention date of an object exceeds Feb 7, 2106, the retention date is calculated from Jan 1, 1970.Is it a bug?
Updated by Casey Bodley 11 months ago
- Status changed from New to Fix Under Review
- Assignee changed from Matt Benjamin to Casey Bodley
- Backport set to pacific quincy reef
- Pull request ID set to 52056
Updated by Casey Bodley 9 months ago
- Subject changed from pacific:rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days to rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days
- Status changed from Fix Under Review to Pending Backport
Updated by Backport Bot 9 months ago
- Copied to Backport #62137: reef: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days added
Updated by Backport Bot 9 months ago
- Copied to Backport #62138: pacific: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days added
Updated by Backport Bot 9 months ago
- Copied to Backport #62139: quincy: rgw_object_lock.cc:The maximum time of bucket object lock is 24855 days added
Updated by Backport Bot 9 months ago
- Tags changed from object-lock low-hanging-fruit to object-lock low-hanging-fruit backport_processed
Updated by Casey Bodley 5 months ago
- Related to Bug #63537: object lock: The query does not match after the worm protection time is set to 2124, 1, 1 added