From: Matt Benjamin Date: Thu, 26 Oct 2017 22:28:10 +0000 (-0400) Subject: rgw_file: set s->obj_size from bytes_written X-Git-Tag: v12.2.2~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=add8c3db195acfda75a1628196e839b0147e7c3f;p=ceph.git rgw_file: set s->obj_size from bytes_written Required to store correct final accounted_size of objects in RGWWriteWriteRequest::write_finish. Fixes: http://tracker.ceph.com/issues/21940 Signed-off-by: Matt Benjamin (cherry picked from commit b1f528d35aeccabb4e5818aec6feb8e53e562500) --- diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index e799861c6adc..a0fd58beff17 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -1403,7 +1403,7 @@ namespace rgw { struct timespec omtime = rgw_fh->get_mtime(); real_time appx_t = real_clock::now(); - s->obj_size = ofs; // XXX check ofs + s->obj_size = bytes_written; perfcounter->inc(l_rgw_put_b, s->obj_size); op_ret = get_store()->check_quota(s->bucket_owner.get_id(), s->bucket, @@ -1412,7 +1412,8 @@ namespace rgw { goto done; } - op_ret = get_store()->check_bucket_shards(s->bucket_info, s->bucket, bucket_quota); + op_ret = get_store()->check_bucket_shards(s->bucket_info, s->bucket, + bucket_quota); if (op_ret < 0) { goto done; }