From 2e2ce365866a7569b55aff338a82c132aa927089 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 May 2016 09:09:43 -0400 Subject: [PATCH] osdc/Objecter: upper bound watch_check result This way we always return a safe upper bound on the amount of time since we did a check. Among other things, this prevents us from returning a value of 0, which is confusing. Fixes: http://tracker.ceph.com/issues/15760 Signed-off-by: Sage Weil --- src/osdc/Objecter.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 4221ba60be48..2d62779a413a 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -706,7 +706,9 @@ int Objecter::linger_check(LingerOp *info) << " age " << age << dendl; if (info->last_error) return info->last_error; - return std::chrono::duration_cast(age).count(); + // return a safe upper bound (we are truncating to ms) + return + 1 + std::chrono::duration_cast(age).count(); } void Objecter::linger_cancel(LingerOp *info) -- 2.47.3