From c86636bf1421778d9c86fbd126db418fa0947318 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Thu, 20 Aug 2026 10:20:54 +0800 Subject: [PATCH] DAOS-19116 object: drop reference when fail in obj_ioc_begin_lite - b26 It is possible that obj_ioc_begin_lite() maybe failed because of empty or stale pool map on server. At that time, the logic has already held reference against the container open handle. Under such case, directly returning error# to the caller may cause reference leak as to such container cannot be properly stopped in subsequent operations. Signed-off-by: Fan Yong --- src/object/srv_obj.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/object/srv_obj.c b/src/object/srv_obj.c index b3aa64162f9..1d34d175c09 100644 --- a/src/object/srv_obj.c +++ b/src/object/srv_obj.c @@ -2271,6 +2271,9 @@ obj_ioc_fini(struct obj_io_context *ioc, int err) } } +static void +obj_ioc_end(struct obj_io_context *ioc, int err); + /* Setup lite IO context, it is only for compound RPC so far: * - no associated object yet * - no permission check (not sure it's read/write) @@ -2374,6 +2377,10 @@ obj_ioc_begin_lite(uint32_t rpc_map_ver, uuid_t pool_uuid, d_tm_inc_gauge(tls->ot_op_active[opc_get(rpc->cr_opc)], 1); ioc->ioc_start_time = daos_get_ntime(); ioc->ioc_began = 1; + + if (rc != 0) + obj_ioc_end(ioc, rc); + return rc; }