]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: return ENOENT from EC getxattr for non-existent objects 69451/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 11 Jun 2026 12:32:34 +0000 (12:32 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 24 Jun 2026 15:55:39 +0000 (15:55 +0000)
PGBackend::getxattr() for EC pools reads from the attr_cache and
returns ENODATA when an attr is not found, without distinguishing
between "object exists but attr not set" and "object doesn't exist".
This causes cls methods like cls_refcount_get() to proceed as if the
object exists, enter the EC RMW pipeline, and hang.

Add an os.exists check in the EC path so non-existent objects return
ENOENT, matching the behavior of the replicated path which goes to
the object store and gets ENOENT directly.

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

index 6a2e57d0992f5863fbc7496ded66690e5f6e6ba9..0c31e28f333d0ddabeba17a2dc3df3a74691557e 100644 (file)
@@ -1170,6 +1170,10 @@ PGBackend::get_attr_ierrorator::future<> PGBackend::getxattr(
     logger().debug("getxattr on obj={} for attr={}", os.oi.soid, name);
     return crimson::ct_error::enodata::make();
   };
+  if (is_erasure() && !os.exists) {
+    logger().debug("getxattr: object {} does not exist (erasure)", os.oi.soid);
+    return crimson::ct_error::enoent::make();
+  }
   return get_attr_maybe_from_cache().safe_then_interruptible(
     [&delta_stats, &osd_op] (ceph::bufferlist&& val) {
     osd_op.outdata = std::move(val);