]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: fix PGBackend::remove() to return ENOENT on no-op deletes 69415/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 11 Jun 2026 11:33:42 +0000 (11:33 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 11 Jun 2026 11:38:02 +0000 (11:38 +0000)
PGBackend::remove() was returning success when asked to delete a
non-existent object or an already-whiteout object that must remain
a whiteout. The classic OSD returns -ENOENT in both cases. Fix both
paths to return enoent, and remove the duplicate !os.exists check.

Fixes: https://tracker.ceph.com/issues/76529
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/crimson/osd/pg_backend.cc

index b8971b2be2bc56e3c59c5b007bdfe62a94f536c0..6a2e57d0992f5863fbc7496ded66690e5f6e6ba9 100644 (file)
@@ -1021,17 +1021,13 @@ PGBackend::remove(ObjectState& os, ceph::os::Transaction& txn,
   bool whiteout,
   int num_bytes)
 {
-  if (!os.exists) {
-    return crimson::ct_error::enoent::make();
-  }
-
   if (!os.exists) {
     logger().debug("{} {} does not exist",__func__, os.oi.soid);
-    return seastar::now();
+    return crimson::ct_error::enoent::make();
   }
   if (whiteout && os.oi.is_whiteout()) {
     logger().debug("{} whiteout set on {} ",__func__, os.oi.soid);
-    return seastar::now();
+    return crimson::ct_error::enoent::make();
   }
   txn.remove(coll->get_cid(),
             ghobject_t{os.oi.soid, ghobject_t::NO_GEN, get_shard()});