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>
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()});