From e6763ebd6124c1b4736c5c7850077df7644bc8f5 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Thu, 29 Jun 2017 15:19:36 -0400 Subject: [PATCH] rgw: cls: ceph::timespan tag_timeout wrong units In rgw_dir_suggest(), the ceph::timespan tag_timeout is intended to be a value in seconds, but has been taken as something much smaller (millis?). The incorrect time scale likely induces a race condition with object deletes. Fixes: http://tracker.ceph.com/issues/20380 Signed-off-by: Matt Benjamin --- src/cls/rgw/cls_rgw.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 05cbb8ce9120b..9af96fe6ab485 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -1875,7 +1875,9 @@ int rgw_dir_suggest_changes(cls_method_context_t hctx, bufferlist *in, bufferlis return rc; } - timespan tag_timeout(header.tag_timeout ? header.tag_timeout : CEPH_RGW_TAG_TIMEOUT); + timespan tag_timeout( + std::chrono::seconds( + header.tag_timeout ? header.tag_timeout : CEPH_RGW_TAG_TIMEOUT)); bufferlist::iterator in_iter = in->begin(); -- 2.47.3