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

Projects
None yet
5 participants
@yuyuyu101
Copy link
Member

commented Oct 23, 2017

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

os/ObjectStore: fix get_data_alignment return -1 causing problem in m…
…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

This comment has been minimized.

Copy link
Contributor

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;

This comment has been minimized.

Copy link
@liu-chunmei

liu-chunmei Oct 23, 2017

Contributor

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

This comment has been minimized.

Copy link
@yuyuyu101

yuyuyu101 Oct 24, 2017

Author Member

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

@yuriw

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2017

ready for merge

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

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
@liewegas

This comment has been minimized.

Copy link
Member

commented Oct 24, 2017

backport to luminous?

@yuyuyu101 yuyuyu101 deleted the yuyuyu101:wip-fix-alignment branch Oct 25, 2017

@yuyuyu101

This comment has been minimized.

Copy link
Member Author

commented Oct 25, 2017

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
You can’t perform that action at this time.