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: v14.1.0~430^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25896%2Fhead;p=ceph.git rbd: fix delay time calculation for trash move Fixes: https://tracker.ceph.com/issues/37861 Signed-off-by: Mykola Golub --- diff --git a/src/tools/rbd/action/Trash.cc b/src/tools/rbd/action/Trash.cc index c2b9f98692ff..783978074b69 100644 --- a/src/tools/rbd/action/Trash.cc +++ b/src/tools/rbd/action/Trash.cc @@ -86,7 +86,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;