Skip to content

Commit 32ecd41

Browse files
committed
DAOS-19116 object: drop reference when fail in obj_ioc_begin_lite
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 <fan.yong@hpe.com>
1 parent d305d2d commit 32ecd41

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/object/srv_obj.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,6 +2252,8 @@ obj_ioc_fini(struct obj_io_context *ioc, int err)
22522252
}
22532253
}
22542254

2255+
static void obj_ioc_end(struct obj_io_context *ioc, int err);
2256+
22552257
/* Setup lite IO context, it is only for compound RPC so far:
22562258
* - no associated object yet
22572259
* - no permission check (not sure it's read/write)
@@ -2355,6 +2357,10 @@ obj_ioc_begin_lite(uint32_t rpc_map_ver, uuid_t pool_uuid,
23552357
d_tm_inc_gauge(tls->ot_op_active[opc_get(rpc->cr_opc)], 1);
23562358
ioc->ioc_start_time = daos_get_ntime();
23572359
ioc->ioc_began = 1;
2360+
2361+
if (rc != 0)
2362+
obj_ioc_end(ioc, rc);
2363+
23582364
return rc;
23592365
}
23602366

0 commit comments

Comments
 (0)