]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: use s->bucket_attrs instead of trying to read obj attrs 3167/head
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 13 Dec 2014 01:07:30 +0000 (17:07 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Sat, 13 Dec 2014 01:15:33 +0000 (17:15 -0800)
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 <yehuda@redhat.com>
src/rgw/rgw_op.cc

index 4100d408675dd0edfd08c16b79dd2784b62071cd..97d64f5e494ca1e683a35076208feabfe6ed0411 100644 (file)
@@ -1897,10 +1897,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) {