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

luminous: cls/user: cls_user_remove_bucket writes modified header #24855

Merged
merged 1 commit into from Nov 1, 2018
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
18 changes: 12 additions & 6 deletions src/cls/user/cls_user.cc
Expand Up @@ -254,17 +254,23 @@ static int cls_user_remove_bucket(cls_method_context_t hctx, bufferlist *in, buf
return ret;
}

if (entry.user_stats_sync) {
dec_header_stats(&header.stats, entry);
}

CLS_LOG(20, "removing entry at %s", key.c_str());

ret = remove_entry(hctx, key);
if (ret < 0)
return ret;

return 0;

if (!entry.user_stats_sync) {
return 0;
}

dec_header_stats(&header.stats, entry);

CLS_LOG(20, "header: total bytes=%lld entries=%lld", (long long)header.stats.total_bytes, (long long)header.stats.total_entries);

bufferlist bl;
encode(header, bl);
return cls_cxx_map_write_header(hctx, &bl);
}

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