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

messages/MOSDPing: initialize MOSDPing padding #15714

Merged
merged 1 commit into from Jun 16, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Copy link
Member

liewegas commented Jun 15, 2017

This memory must be initialized or else valgrind will be very unhappy.

Avoid the cost of zeroing (or even allocating) the buffer for normal
padding values by (re)using a static zero buffer.

Fixes: http://tracker.ceph.com/issues/20323
Signed-off-by: Sage Weil sage@redhat.com

@tchaikov
Copy link
Contributor

tchaikov left a comment

aside from the nit, lgtm

pad.append(buffer::create_static(s, zeros));
} else {
// this allocates and zeros memory.. slower!
pad.append_zero(s);

This comment has been minimized.

Copy link
@tchaikov

tchaikov Jun 16, 2017

Contributor
while (s > sizeof(zeros)) {
  pad.append(buffer::create_static(sizeof(zeros), zeros));
  s -= sizeof(zeros);
}
if (s) {
  pad.append(buffer::create_static(s, zeros);
}
messages/MOSDPing: initialize MOSDPing padding
This memory must be initialized or else valgrind will be very unhappy.

Avoid the cost of zeroing (or even allocating) the buffer for normal
padding values by (re)using a static zero buffer.

Fixes: http://tracker.ceph.com/issues/20323
Signed-off-by: Sage Weil <sage@redhat.com>

@liewegas liewegas force-pushed the liewegas:wip-20323 branch from 58a62b2 to 9beaf5e Jun 16, 2017

@liewegas liewegas merged commit 965392e into ceph:master Jun 16, 2017

2 of 4 checks passed

arm64 make check arm64 make check failed
Details
make check make check failed
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
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.