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

os/ObjectStore: fix get_data_alignment return -1 causing problem in msg header #18475

Merged
merged 1 commit into from Oct 24, 2017

Conversation

yuyuyu101
Copy link
Member

sizeof(data_off) in ceph_msg_header is uint16_t, so -1 will be 65535. When peer
side receive MOSDRepOp message, it will allocate extra 1 byte buffer to store
nonexisted buffer.

Signed-off-by: Haomai Wang haomai@xsky.com

…sg header

sizeof(data_off) in ceph_msg_header is uint16_t, so -1 will be 65535. When peer
side receive MOSDRepOp message, it will allocate extra 1 byte buffer to store
nonexisted buffer.

Signed-off-by: Haomai Wang <haomai@xsky.com>
@yuriw
Copy link
Contributor

yuriw commented Oct 23, 2017

@@ -853,7 +853,7 @@ class ObjectStore {
/// offset of buffer as aligned to destination within object.
int get_data_alignment() {
if (!data.largest_data_len)
return -1;
return 0;
return (0 - get_data_offset()) & ~CEPH_PAGE_MASK;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the next line 857 0 - get_data_offset() is also negative, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it should be ok, because (& ~CEPH_PAGE_MASK) will get a right value

@yuriw
Copy link
Contributor

yuriw commented Oct 24, 2017

ready for merge

@liewegas liewegas merged commit f3ad340 into ceph:master Oct 24, 2017
@liewegas
Copy link
Member

backport to luminous?

@yuyuyu101 yuyuyu101 deleted the wip-fix-alignment branch October 25, 2017 01:26
@yuyuyu101
Copy link
Member Author

I think extra 1 byte bufferptr doesn't make so bad effect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants