]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't convert object mtime to UTC
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 7 Nov 2012 21:21:15 +0000 (13:21 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 13 Nov 2012 18:32:27 +0000 (10:32 -0800)
Fixes: #3452
When we read object info, don't try to convert mtime to
UTC, it's already in UTC.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_rados.cc

index b468b6f042f59ed204b4ab877f3d4073c204d675..ac2759e64612f8429cf4661507be0025f149f7b0 100644 (file)
@@ -2224,14 +2224,7 @@ int RGWRados::prepare_get_obj(void *ctx, rgw_obj& obj,
 
   /* Convert all times go GMT to make them compatible */
   if (mod_ptr || unmod_ptr) {
-    struct tm mtm;
-    struct tm *gmtm = gmtime_r(&astate->mtime, &mtm);
-    if (!gmtm) {
-       ldout(cct, 0) << "NOTICE: could not get translate mtime for object" << dendl;
-       r = -EINVAL;
-       goto done_err;
-    }
-    ctime = mktime(gmtm);
+    ctime = astate->mtime;
 
     if (mod_ptr) {
       ldout(cct, 10) << "If-Modified-Since: " << *mod_ptr << " Last-Modified: " << ctime << dendl;