Changing the end of second interval from
2096640 to copyup_end - 512
with copyup_end potentially set to 1 << order in commit
750e61ac91d7
("librbd: clone copy-on-write operations should preserve sparseness")
was incorrect because the test image size is just 2M. There are no
end-to-end tests for enable_sparse_copyup = false case, so this went
unnoticed.
A year later, commit
38622b5ca12d ("librbd: copyup state machine
should always issue a sparse-read") dropped the respective branch in
CopyupRequest, thus eliminating the reason for branching on
enable_sparse_copyup altogether.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
librados::snap_set_t snap_set;
ASSERT_EQ(0, snap_ctx.list_snaps(ictx2->get_object_name(0), &snap_set));
- uint64_t copyup_end = ictx2->enable_sparse_copyup ? 4096 * 5 : 1 << order;
std::vector< std::pair<uint64_t,uint64_t> > expected_overlap =
boost::assign::list_of(
std::make_pair(0, 4096))(
- std::make_pair(4096 * 2, copyup_end - 4096 * 2));
+ std::make_pair(4096 * 2, 4096 * 3));
ASSERT_EQ(2U, snap_set.clones.size());
ASSERT_NE(CEPH_NOSNAP, snap_set.clones[0].cloneid);
ASSERT_EQ(2U, snap_set.clones[0].snaps.size());