Previously we were casting it to a uint64_t, but the left shift
occurs before the cast, so we were overflowing in some circumstances.
Split these up to prevent it.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
}
if (create && (oldsize < conf_journal_sz)) {
- uint64_t newsize = (uint64_t)g_conf.osd_journal_size << 20;
+ uint64_t newsize(g_conf.osd_journal_size);
+ newsize <<= 20;
dout(10) << "_open extending to " << newsize << " bytes" << dendl;
ret = ::ftruncate(fd, newsize);
if (ret < 0) {