CID 717014: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "in->inode.layout.fl_object_size.operator unsigned int() * in->inode.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>
dout(10) << "purge_stray dir ... implement me!" << dendl; // FIXME XXX
_purge_stray_purged(dn);
} else if (in->is_file()) {
- uint64_t period = in->inode.layout.fl_object_size * in->inode.layout.fl_stripe_count;
+ uint64_t period = (uint64_t)in->inode.layout.fl_object_size * (uint64_t)in->inode.layout.fl_stripe_count;
uint64_t cur_max_size = in->inode.get_max_size();
uint64_t to = MAX(in->inode.size, cur_max_size);
if (to && period) {