CID 717015 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
Potentially overflowing expression "this->layout.fl_object_size.operator unsigned int() * this->layout.fl_stripe_count.operator unsigned int()" with type "unsigned int" (32 bits, unsigned) 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 either operand to "uint64_t" before performing the multiplication.
Signed-off-by: Sage Weil <sage@inktank.com>
}
uint64_t get_layout_size_increment() {
- return layout.fl_object_size * layout.fl_stripe_count;
+ return (uint64_t)layout.fl_object_size * (uint64_t)layout.fl_stripe_count;
}
bool is_dirty_rstat() const { return !(rstat == accounted_rstat); }