Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: don't write bucket_header when it is not changed in bucket_link/unlink #17356

Merged
merged 1 commit into from
Sep 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/cls/rgw/cls_rgw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
struct rgw_bucket_dir_header header;
ret = read_bucket_header(hctx, &header);
if (ret < 0) {
CLS_LOG(1, "ERROR: rgw_bucket_unlink_instance(): failed to read header\n");
CLS_LOG(1, "ERROR: rgw_bucket_link_olh(): failed to read header\n");
return ret;
}

Expand All @@ -1543,9 +1543,11 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
powner, powner_display_name, &op.zones_trace);
if (ret < 0)
return ret;

return write_bucket_header(hctx, &header); /* updates header version */
}

return write_bucket_header(hctx, &header); /* updates header version */
return 0;
}

static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
Expand Down Expand Up @@ -1689,9 +1691,11 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
op.bilog_flags | RGW_BILOG_FLAG_VERSIONED_OP, NULL, NULL, &op.zones_trace);
if (ret < 0)
return ret;

return write_bucket_header(hctx, &header); /* updates header version */
}

return write_bucket_header(hctx, &header); /* updates header version */
return 0;
}

static int rgw_bucket_read_olh_log(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
Expand Down