This was off by one (too few) in the case of a
trimmedpos->write_pos range that had length
layout_period+2 and starting position one byte
before a period boundary.
Signed-off-by: John Spray <john.spray@inktank.com>
{
// Async delete the journal data
uint64_t first = trimmed_pos / get_layout_period();
- uint64_t num = (write_pos - trimmed_pos) / get_layout_period() + 1;
+ uint64_t num = (write_pos - trimmed_pos) / get_layout_period() + 2;
filer.purge_range(ino, &layout, SnapContext(), first, num, ceph_clock_now(cct), 0,
new C_EraseFinish(this, completion));