From 97dacdeeaa997c16c08c121952b979553ab71f33 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Thu, 10 Jan 2019 15:15:36 +0000 Subject: [PATCH] rbd: fix delay time calculation for trash move Fixes: https://tracker.ceph.com/issues/37861 Signed-off-by: Mykola Golub (cherry picked from commit 947351e62644bc64f8215ee2ce47ff0264c732b1) --- src/tools/rbd/action/Trash.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd/action/Trash.cc b/src/tools/rbd/action/Trash.cc index 3bcceda75a36..1f751716f457 100644 --- a/src/tools/rbd/action/Trash.cc +++ b/src/tools/rbd/action/Trash.cc @@ -84,7 +84,7 @@ int execute_move(const po::variables_map &vm, } } - time_t dt = exp_time.sec() - now.sec(); + time_t dt = (exp_time - now).sec(); if(dt < 0) { std::cerr << "rbd: cannot use a date in the past as an expiration date" << std::endl; -- 2.47.3