]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix a bug that multipart upload may exceed the quota because of 12010/head
authorZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Wed, 16 Nov 2016 02:52:54 +0000 (10:52 +0800)
committerZhang Shaowen <zhangshaowen@cmss.chinamobile.com>
Thu, 13 Apr 2017 06:05:24 +0000 (14:05 +0800)
improperly operation to the cache.

Fixes: http://tracker.ceph.com/issues/19602
Signed-off-by: Zhang Shaowen <zhangshaowen@cmss.chinamobile.com>
src/rgw/rgw_rados.cc

index 352c87e7b7fc2cde36feb508b4fad6e044203985..78a68cf65c204dfbcec67542e48da7fd0f0ff1ae 100644 (file)
@@ -6343,9 +6343,16 @@ int RGWRados::Object::Write::write_meta(uint64_t size, uint64_t accounted_size,
   string index_tag;
   uint64_t epoch;
   int64_t poolid;
-
-  bool orig_exists = state->exists;
-  uint64_t orig_size = state->accounted_size;
+  bool orig_exists;
+  uint64_t orig_size;
+  
+  if (!reset_obj) {    //Multipart upload, it has immutable head. 
+    orig_exists = false;
+    orig_size = 0;
+  } else {
+    orig_exists = state->exists;
+    orig_size = state->accounted_size;
+  }
 
   bool versioned_target = (meta.olh_epoch > 0 || !obj.get_instance().empty());