]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Added code to correctly account for bytes sent/ received during a 'PUT' operation. 16174/head
authorPritha Srivastava <prsrivas@redhat.com>
Mon, 20 Mar 2017 06:11:48 +0000 (11:41 +0530)
committerNathan Cutler <ncutler@suse.com>
Thu, 6 Jul 2017 14:53:01 +0000 (16:53 +0200)
Currently, the bytes sent/ received are both set to zero after
an object is uploaded to a bucket. Added code to correct the logic.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit 85735c972f5db1a110f55e01a4f6249202152553)

src/rgw/rgw_rest.cc

index 2ca556e20b8df4d6d753a8ed1a2bba5b43024695..bad83ca22bacca3a5c25e995c2e652e43b2f667d 100644 (file)
@@ -1192,6 +1192,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
 
   int len = 0;
   if (cl) {
+    ACCOUNTING_IO(s)->set_account(true);
     bufferptr bp(cl);
 
     const auto read_len  = recv_body(s, bp.c_str(), cl);
@@ -1222,7 +1223,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
         bl.rebuild();
       }
     }
-
+    ACCOUNTING_IO(s)->set_account(false);
   }
 
   if ((uint64_t)ofs + len > s->cct->_conf->rgw_max_put_size) {