Added assert to verify that omap prefixes between cloned objects are exactly the same.
If they would differ rewrite_omap_key() will possibly overwrite user key potion of data,
or move some part of prefix into user key.
This is a follow up from
https://github.com/ceph/ceph/pull/43687
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
} else {
newo->onode.set_omap_flags(per_pool_omap == OMAP_BULK);
}
+ // check if prefix for omap key is exactly the same size for both objects
+ // otherwise rewrite_omap_key will corrupt data
+ ceph_assert(oldo->onode.flags == newo->onode.flags);
const string& prefix = newo->get_omap_prefix();
KeyValueDB::Iterator it = db->get_iterator(prefix);
string head, tail;