]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: only allow clone if hash matches
authorSage Weil <sage@redhat.com>
Fri, 18 Dec 2015 22:41:01 +0000 (17:41 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jan 2016 18:07:25 +0000 (13:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 0302b7d04f97b272db10f12207643a407036397c..5522f317e23add73d3aba038501597d0b29f6766 100644 (file)
@@ -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;