The return code for creating bucket is wrong

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When creating an existing bucket with s3cmd, the return code is not BucketAlreadyExists.
~# s3cmd ls
2017-12-15 06:37  s3://lyb   <----------------------  bucket is exist
2017-12-21 01:46  s3://myz
~# s3cmd mb s3://lyb
Bucket '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_ret
2768                << 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_EXISTS
2772   }


1193 void RGWCreateBucket_ObjStore_S3::send_response()
1194 {
1195   if (op_ret == -ERR_BUCKET_EXISTS)   <-------------------------------------------- ERR_BUCKET_EXISTS is changed to 0
1196     op_ret = 0;

Is anyone know the reason that ERR_BUCKET_EXISTS is modified to zero? Thanks.
_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux