The second arg for interval_set insert method is the inserting
interval lenth, while the end position was provided. It still
worked correctly, because the end position value is always larger
than the truncated length.
Signed-off-by: Mykola Golub <mgolub@suse.com>
// clip diff to size of object (in case it was truncated)
if (end_size < prev_end_size) {
interval_set<uint64_t> trunc;
- trunc.insert(end_size, prev_end_size);
+ trunc.insert(end_size, prev_end_size - end_size);
trunc.intersection_of(diff);
diff.subtract(trunc);
ldout(m_cct, 20) << "clearing truncate diff: " << trunc << dendl;