From: Sage Weil Date: Wed, 27 Jan 2016 19:20:29 +0000 (-0500) Subject: Revert "BlueStore: fix dest onode process logic of clone" X-Git-Tag: v10.0.4~101^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbd5cd4a17fe7dac63c7214ec3dcc6cb2b5294db;p=ceph.git Revert "BlueStore: fix dest onode process logic of clone" This reverts commit 1c70f86316e5ff29ef7168ebfb3513def770b436. The truncate is cheap if the object is empty, and we need to call _assign_nid unconditionally. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index ef67d80b62e2..95e5bb56e3ef 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5954,22 +5954,18 @@ int BlueStore::_clone(TransContext *txc, r = -ENOENT; goto out; } - - newo = c->get_onode(new_oid, false); - if (newo) { - r = _do_truncate(txc, c, newo, 0); - if (r < 0) - goto out; - } else { - newo = c->get_onode(new_oid, true); - _assign_nid(txc, newo); - } + newo = c->get_onode(new_oid, true); assert(newo); newo->exists = true; + _assign_nid(txc, newo); // data oldo->flush(); + r = _do_truncate(txc, c, newo, 0); + if (r < 0) + goto out; + if (g_conf->bluestore_clone_cow) { EnodeRef e = c->get_enode(newo->oid.hobj.get_hash()); bool marked = false;