From: Mykola Golub Date: Thu, 10 Jan 2019 15:15:36 +0000 (+0000) Subject: rbd: fix delay time calculation for trash move X-Git-Tag: v13.2.5~101^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25954%2Fhead;p=ceph.git 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) --- 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;