Merge pull request #3167 from ceph/wip-10307

rgw: use s->bucket_attrs instead of trying to read obj attrs

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Josh Durgin 2015-01-07 13:23:44 -08:00
commit f31020dac2

View File

@ -1911,10 +1911,14 @@ void RGWPutMetadata::execute()
/* no need to track object versioning, need it for bucket's data only */
RGWObjVersionTracker *ptracker = (s->object ? NULL : &s->bucket_info.objv_tracker);
/* check if obj exists, read orig attrs */
ret = get_obj_attrs(store, s, obj, orig_attrs, NULL, ptracker);
if (ret < 0)
return;
if (s->object) {
/* check if obj exists, read orig attrs */
ret = get_obj_attrs(store, s, obj, orig_attrs, NULL, ptracker);
if (ret < 0)
return;
} else {
orig_attrs = s->bucket_attrs;
}
if (!s->object && !placement_rule.empty()) {
if (placement_rule != s->bucket_info.placement_rule) {