]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd: use 64-bits to shift order
authorJosh Durgin <josh.durgin@inktank.com>
Mon, 24 Sep 2012 21:25:26 +0000 (14:25 -0700)
committerSamuel Just <sam.just@inktank.com>
Tue, 25 Sep 2012 21:09:27 +0000 (14:09 -0700)
commit74b85e7cdf6b897a649b3462150a60498a6758ed
tree9ec9f49c9c846639e6f18f81889a873dcaacedea
parent11da12fa49814626d69f47636772fdd9acc65c7c
librbd: use 64-bits to shift order

Order is never actually this high currently, but it be via librbd.

CID 716937: Overflowed return value (INTEGER_OVERFLOW)
At (3): Overflowed or truncated value (or a value computed from an
overflowed or truncated value) "offset" used as return value.

CID 717012: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << obj_order" with type
"int" (32 bits, signed) is evaluated using 32-bit arithmetic before
being used in a context which expects an expression of type "uint64_t"
(64 bits, unsigned). To avoid overflow, cast the left operand to
"uint64_t" before performing the left shift.

CID 717011: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << order" with type
"int" (32 bits, signed) is evaluated using 32-bit arithmetic before
being used in a context which expects an expression of type "uint64_t"
(64 bits, unsigned). To avoid overflow, cast the left operand to
"uint64_t" before performing the left shift.

CID 717013: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << order" with type
"int" (32 bits, signed) is evaluated using 32-bit arithmetic before
being used in a context which expects an expression of type "uint64_t"
(64 bits, unsigned). To avoid overflow, cast the left operand to
"uint64_t" before performing the left shift.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librbd/internal.cc