]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_op: added check of return value for rgw_unlink_bucket()
authorXing Lin <xinglin@cs.utah.edu>
Thu, 28 Nov 2013 06:35:50 +0000 (23:35 -0700)
committerXing Lin <xinglin@cs.utah.edu>
Tue, 3 Dec 2013 18:19:13 +0000 (11:19 -0700)
checked the return value of rgw_unlink_bucket() in RGWCreateBucket::execute()

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
src/rgw/rgw_op.cc

index bd73a239a4bf1fbfe253e651f07bc3857a91a015..8cd85015c23bd8d6f6046afcb1a0cbb0ecd4e564 100644 (file)
@@ -1198,8 +1198,12 @@ void RGWCreateBucket::execute()
   }
 
   ret = rgw_link_bucket(store, s->user.user_id, s->bucket, info.creation_time, false);
-  if (ret && !existed && ret != -EEXIST)   /* if it exists (or previously existed), don't remove it! */
-    rgw_unlink_bucket(store, s->user.user_id, s->bucket.name);
+  if (ret && !existed && ret != -EEXIST) {  /* if it exists (or previously existed), don't remove it! */
+    ret = rgw_unlink_bucket(store, s->user.user_id, s->bucket.name);
+    if (ret < 0) {
+      ldout(s->cct, 0) << "WARNING: failed to unlink bucket: ret=" << ret << dendl;
+    }
+  }
 
   if (ret == -EEXIST)
     ret = -ERR_BUCKET_EXISTS;