From: Yehuda Sadeh Date: Sat, 13 Dec 2014 01:07:30 +0000 (-0800) Subject: rgw: use s->bucket_attrs instead of trying to read obj attrs X-Git-Tag: v0.80.9~22^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd49cbc535d0d7fa64ebfa458386b47c8ec8616e;p=ceph.git rgw: use s->bucket_attrs instead of trying to read obj attrs Fixes: #10307 Backport: firefly, giant This is needed, since we can't really read the bucket attrs by trying to read the bucket entry point attrs. We already have the bucket attrs anyway, use these. Signed-off-by: Yehuda Sadeh (cherry picked from commit 5cf193c8686196d5235889e68cb5ea8f1fc8e556) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 1c22c68ccc59..cd1f3a1dbffa 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1884,10 +1884,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; + } /* only remove meta attrs */ for (iter = orig_attrs.begin(); iter != orig_attrs.end(); ++iter) {