]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix decoding of creation_time and last_update. 12764/head
authorOrit Wasserman <owasserm@redhat.com>
Mon, 19 Sep 2016 13:05:22 +0000 (15:05 +0200)
committerNathan Cutler <ncutler@suse.com>
Tue, 3 Jan 2017 15:18:44 +0000 (16:18 +0100)
Fixes: http://tracker.ceph.com/issues/17167
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
(cherry picked from commit 3afe715381ca63539bb20609b614f5e60561711a)

src/rgw/rgw_json_enc.cc

index 0062dc5ea11209b1520f92b637fd8da051e3a16b..1d460eba7022658e64f378818f063dcbf0570ab5 100644 (file)
@@ -536,8 +536,9 @@ void RGWBucketEntryPoint::dump(Formatter *f) const
 void RGWBucketEntryPoint::decode_json(JSONObj *obj) {
   JSONDecoder::decode_json("bucket", bucket, obj);
   JSONDecoder::decode_json("owner", owner, obj);
-  utime_t ut(creation_time);
+  utime_t ut;
   JSONDecoder::decode_json("creation_time", ut, obj);
+  creation_time = ut.to_real_time();
   JSONDecoder::decode_json("linked", linked, obj);
   JSONDecoder::decode_json("has_bucket_info", has_bucket_info, obj);
   if (has_bucket_info) {
@@ -650,8 +651,9 @@ void RGWBucketInfo::dump(Formatter *f) const
 
 void RGWBucketInfo::decode_json(JSONObj *obj) {
   JSONDecoder::decode_json("bucket", bucket, obj);
-  utime_t ut(creation_time);
+  utime_t ut;
   JSONDecoder::decode_json("creation_time", ut, obj);
+  creation_time = ut.to_real_time();
   JSONDecoder::decode_json("owner", owner, obj);
   JSONDecoder::decode_json("flags", flags, obj);
   JSONDecoder::decode_json("zonegroup", zonegroup, obj);
@@ -1037,8 +1039,9 @@ void RGWMetadataLogInfo::dump(Formatter *f) const
 void RGWMetadataLogInfo::decode_json(JSONObj *obj)
 {
   JSONDecoder::decode_json("marker", marker, obj);
-  utime_t ut(last_update);
+  utime_t ut;
   JSONDecoder::decode_json("last_update", ut, obj);
+  last_update = ut.to_real_time();
 }
 
 void RGWDataChangesLogInfo::dump(Formatter *f) const
@@ -1051,8 +1054,9 @@ void RGWDataChangesLogInfo::dump(Formatter *f) const
 void RGWDataChangesLogInfo::decode_json(JSONObj *obj)
 {
   JSONDecoder::decode_json("marker", marker, obj);
-  utime_t ut(last_update);
+  utime_t ut;
   JSONDecoder::decode_json("last_update", ut, obj);
+  last_update = ut.to_real_time();
 }