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

rbd: use min<uint64_t>() explicitly #14202

Merged
merged 1 commit into from Mar 29, 2017

Conversation

Projects
None yet
2 participants
@tchaikov
Contributor

tchaikov commented Mar 28, 2017

on arm32, size_t is actually int, which cannot be compared with uint64_t
using std::min().

Fixes: http://tracker.ceph.com/issues/18938
Signed-off-by: Kefu Chai kchai@redhat.com

@tchaikov tchaikov added the rbd label Mar 28, 2017

@tchaikov tchaikov requested a review from dillaman Mar 28, 2017

@@ -259,13 +259,13 @@ static int skip_tag(int fd, uint64_t length)
if (fd == STDIN_FILENO) {
// read the appending data out to skip this tag.
char buf[4096];
uint64_t len = min(length, sizeof(buf));
uint64_t len = min(length, static_cast<uint64_t>(sizeof(buf)));

This comment has been minimized.

@dillaman

dillaman Mar 28, 2017

Contributor

Nit: I would prefer the std::min<uint64_t>(a, b) style

This comment has been minimized.

@tchaikov

tchaikov Mar 28, 2017

Contributor

sure, more concise.

@dillaman dillaman added the cleanup label Mar 28, 2017

rbd: use min<uint64_t>() explicitly
on arm32, size_t is actually int, which cannot be compared with uint64_t
using std::min().

Fixes: http://tracker.ceph.com/issues/18938
Signed-off-by: Kefu Chai <kchai@redhat.com>

@tchaikov tchaikov changed the title from rbd: cast size_t to uint64_t before comparing it with an uint64_t to rbd: use min<uint64_t>() explicitly Mar 28, 2017

@dillaman

This comment has been minimized.

Contributor

dillaman commented Mar 28, 2017

retest this please

@dillaman

lgtm

@dillaman dillaman merged commit 49366c2 into ceph:master Mar 29, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@tchaikov tchaikov deleted the tchaikov:wip-cast-size_t-arm32 branch Mar 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment