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

cls_rbd: change object_map_update to return 0 on success, add logging #6467

Merged
merged 1 commit into from
Nov 6, 2015
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
12 changes: 11 additions & 1 deletion src/cls/rbd/cls_rbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
::decode(new_object_state, iter);
::decode(current_object_state, iter);
} catch (const buffer::error &err) {
CLS_ERR("failed to decode message");
return -EINVAL;
}

Expand All @@ -2212,6 +2213,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
bufferlist header_bl;
r = cls_cxx_read(hctx, 0, object_map.get_header_length(), &header_bl);
if (r < 0) {
CLS_ERR("object map header read failed");
return r;
}

Expand Down Expand Up @@ -2247,6 +2249,7 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
r = cls_cxx_read(hctx, object_map.get_header_length() + byte_offset,
byte_length, &data_bl);
if (r < 0) {
CLS_ERR("object map data read failed");
return r;
}

Expand Down Expand Up @@ -2285,8 +2288,15 @@ int object_map_update(cls_method_context_t hctx, bufferlist *in, bufferlist *out
object_map.encode_footer(footer_bl);
r = cls_cxx_write(hctx, object_map.get_footer_offset(), footer_bl.length(),
&footer_bl);
} else {
CLS_LOG(20, "object_map_update: no update necessary");
}
return r;

if (r < 0) {
return r;
}

return 0;
}

/**
Expand Down