From 2e5fcf7b46d1f58fbb4e96e73bce543c90f86c65 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Tue, 27 Aug 2019 04:49:40 +0000 Subject: [PATCH] ceph-objectstore-tool: Ignore snapset error if just removing head with --force Fixes: https://tracker.ceph.com/issues/41522 Signed-off-by: David Zafman --- src/tools/ceph_objectstore_tool.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 0ea7fce95ae40..c91403d68137c 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -2083,7 +2083,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; } // cout << "snapset " << ss << std::endl; if (!ss.clone_snaps.empty() && !all) { -- 2.39.5