When creating an existing bucket with s3cmd, the return code is not
BucketAlreadyExists.~# s3cmd ls2017-12-15 06:37 s3://lyb
<---------------------- bucket is exist2017-12-21 01:46 s3://myz~# s3cmd mb
s3://lybBucket 's3://lyb/' created <---------------------- the creation
success
dig into the code, the ERR_BUCKET_EXISTS is modified to zero in function
send_response.2570 void RGWCreateBucket::execute()2571 {. . . 2760 op_ret =
rgw_link_bucket(store, s->user->user_id, s->bucket,2761
info.creation_time, false);2762 if (op_ret && !existed && op_ret != -EEXIST)
{2763 /* if it exists (or previously existed), don't remove it! */2764
op_ret = rgw_unlink_bucket(store, s->user->user_id, s->bucket.tenant,2765
s->bucket.name);2766 if (op_ret < 0) {2767 ldout(s->cct,
0) << "WARNING: failed to unlink bucket: ret=" << op_ret2768 <<
dendl;2769 }2770 } else if (op_ret == -EEXIST || (op_ret == 0 &&
existed)) {2771 op_ret = -ERR_BUCKET_EXISTS;
<-------------------------------------------- the return code is set to
ERR_BUCKET_EXISTS2772 }
1193 void RGWCreateBucket_ObjStore_S3::send_response()1194 {1195 if (op_ret
== -ERR_BUCKET_EXISTS) <--------------------------------------------
ERR_BUCKET_EXISTS is changed to 01196 op_ret = 0;
Is anyone know the reason that ERR_BUCKET_EXISTS is modified to zero? Thanks._______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com