To reproduce the issue one can expand device of 3,147,480,064 bytes to
4,147,480,064 using bluefs-bdev-expand command.
Subsequent fsck will detect the leakage.
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
uint64_t blocks0 = size / bytes_per_block;
if (blocks0 / blocks_per_key * blocks_per_key != blocks0) {
- blocks0 = (blocks / blocks_per_key + 1) * blocks_per_key;
+ blocks0 = (blocks0 / blocks_per_key + 1) * blocks_per_key;
dout(10) << __func__ << " rounding blocks up from 0x" << std::hex << size
<< " to 0x" << (blocks0 * bytes_per_block)
<< " (0x" << blocks0 << " blocks)" << std::dec << dendl;
- // reset past-eof blocks to unallocated
+ // reset previous past-eof blocks to unallocated
_xor(size, blocks0 * bytes_per_block - size, txn);
}