Skip to content

Commit 8217ae2

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 8217ae2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/object/srv_obj.c

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

2255+
static void
2256+
obj_ioc_end(struct obj_io_context *ioc, int err);
2257+
22552258
/* Setup lite IO context, it is only for compound RPC so far:
22562259
* - no associated object yet
22572260
* - no permission check (not sure it's read/write)
@@ -2355,6 +2358,10 @@ obj_ioc_begin_lite(uint32_t rpc_map_ver, uuid_t pool_uuid,
23552358
d_tm_inc_gauge(tls->ot_op_active[opc_get(rpc->cr_opc)], 1);
23562359
ioc->ioc_start_time = daos_get_ntime();
23572360
ioc->ioc_began = 1;
2361+
2362+
if (rc != 0)
2363+
obj_ioc_end(ioc, rc);
2364+
23582365
return rc;
23592366
}
23602367

0 commit comments

Comments
 (0)