From: David Zafman Date: Tue, 27 Aug 2019 04:49:40 +0000 (+0000) Subject: ceph-objectstore-tool: Ignore snapset error if just removing head with --force X-Git-Tag: v14.2.5~180^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c70da8780d095b5637f8a9d3cf5960a4d9998367;p=ceph.git ceph-objectstore-tool: Ignore snapset error if just removing head with --force Fixes: https://tracker.ceph.com/issues/41522 Signed-off-by: David Zafman (cherry picked from commit 2e5fcf7b46d1f58fbb4e96e73bce543c90f86c65) --- diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 162cec99a6a..bef0be61663 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -1947,7 +1947,9 @@ int do_remove_object(ObjectStore *store, coll_t coll, r = get_snapset(store, coll, ghobj, ss, false); if (r < 0) { cerr << "Can't get snapset error " << cpp_strerror(r) << std::endl; - return r; + // If --force and bad snapset let them remove the head + if (!(force && !all)) + return r; } if (!ss.snaps.empty() && !all) { if (force) {