From: Sage Weil Date: Fri, 18 Dec 2015 22:41:01 +0000 (-0500) Subject: os/bluestore/BlueStore: only allow clone if hash matches X-Git-Tag: v10.0.3~154^2~71 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8ebb3901ccdc583134ced9dabd23b80c7a8033e2;p=ceph.git os/bluestore/BlueStore: only allow clone if hash matches Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 0302b7d04f97..5522f317e23a 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5477,6 +5477,11 @@ int BlueStore::_clone(TransContext *txc, dout(15) << __func__ << " " << c->cid << " " << old_oid << " -> " << new_oid << dendl; int r = 0; + if (old_oid.hobj.get_hash() != new_oid.hobj.get_hash()) { + derr << __func__ << " mismatched hash on " << old_oid << " and " << new_oid + << dendl; + return -EINVAL; + } RWLock::WLocker l(c->lock); bufferlist bl;