Skip to content

Commit

Permalink
rgw: remove useless lines in RGWDeleteBucket::execute
Browse files Browse the repository at this point in the history
Signed-off-by: Bingyin Zhang <zhangbingyin@cloudin.cn>
  • Loading branch information
Bingyin Zhang committed Dec 27, 2017
1 parent 6d61076 commit 4ecbd0b
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/rgw/rgw_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2841,19 +2841,19 @@ void RGWDeleteBucket::pre_exec()

void RGWDeleteBucket::execute()
{
op_ret = -EINVAL;

if (s->bucket_name.empty())
if (s->bucket_name.empty()) {
op_ret = -EINVAL;
return;
}

if (!s->bucket_exists) {
ldout(s->cct, 0) << "ERROR: bucket " << s->bucket_name << " not found" << dendl;
op_ret = -ERR_NO_SUCH_BUCKET;
return;
}

RGWObjVersionTracker ot;
ot.read_version = s->bucket_info.ep_objv;

if (s->system_request) {
string tag = s->info.args.get(RGW_SYS_PARAM_PREFIX "tag");
string ver_str = s->info.args.get(RGW_SYS_PARAM_PREFIX "ver");
Expand All @@ -2872,7 +2872,7 @@ void RGWDeleteBucket::execute()
}

op_ret = rgw_bucket_sync_user_stats(store, s->user->user_id, s->bucket_info);
if ( op_ret < 0) {
if (op_ret < 0) {
ldout(s->cct, 1) << "WARNING: failed to sync user stats before bucket delete: op_ret= " << op_ret << dendl;
}

Expand All @@ -2896,7 +2896,6 @@ void RGWDeleteBucket::execute()
}

string prefix, delimiter;

if (s->prot_flags & RGW_REST_SWIFT) {
string path_args;
path_args = s->info.args.get("path");
Expand All @@ -2911,13 +2910,11 @@ void RGWDeleteBucket::execute()
}

op_ret = abort_bucket_multiparts(store, s->cct, s->bucket_info, prefix, delimiter);

if (op_ret < 0) {
return;
}

op_ret = store->delete_bucket(s->bucket_info, ot, false);

if (op_ret == -ECANCELED) {
// lost a race, either with mdlog sync or another delete bucket operation.
// in either case, we've already called rgw_unlink_bucket()
Expand All @@ -2933,12 +2930,6 @@ void RGWDeleteBucket::execute()
<< dendl;
}
}

if (op_ret < 0) {
return;
}


}

int RGWPutObj::verify_permission()
Expand Down

0 comments on commit 4ecbd0b

Please sign in to comment.