]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix delay time calculation for trash move 25954/head
authorMykola Golub <mgolub@suse.com>
Thu, 10 Jan 2019 15:15:36 +0000 (15:15 +0000)
committerPrashant D <pdhange@redhat.com>
Tue, 15 Jan 2019 01:50:04 +0000 (20:50 -0500)
Fixes: https://tracker.ceph.com/issues/37861
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 947351e62644bc64f8215ee2ce47ff0264c732b1)

src/tools/rbd/action/Trash.cc

index 3bcceda75a36c3b76730701dd91ff168abf412d5..1f751716f4576f45d364b4f532f615265c54ba2c 100644 (file)
@@ -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;