librbd: deep_copy: update end_size only if zero interval caused truncate

The problem shown up when stripping was used, and assembling a
nonexistent destination object from source objects, and one of these
objects existed and snap diff returned a zero interval. The non-zero
end_size in that case triggered invalid object map update.

Signed-off-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
Mykola Golub 2018-06-19 15:05:27 +03:00
parent d3d730ce0f
commit d1122573b8

View File

@ -887,7 +887,7 @@ void ObjectCopyRequest<I>::compute_zero_ops() {
ldout(m_cct, 20) << "COPY_OP_TYPE_TRUNC " << z.get_start() << dendl;
}
}
end_size = z.get_start();
end_size = std::min(end_size, z.get_start());
} else {
// zero interval inside the object
m_write_ops[src_snap_seq]