diff --git a/src/container/srv_target.c b/src/container/srv_target.c index 2d5ef014627..3961f41dcaf 100644 --- a/src/container/srv_target.c +++ b/src/container/srv_target.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2016-2023 Intel Corporation. + * (C) Copyright 2016-2024 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -1724,9 +1724,14 @@ ds_cont_tgt_close(uuid_t pool_uuid, uuid_t hdl_uuid) struct coll_close_arg arg; uuid_copy(arg.uuid, hdl_uuid); - return ds_pool_thread_collective(pool_uuid, - PO_COMP_ST_NEW | PO_COMP_ST_DOWN | PO_COMP_ST_DOWNOUT, - cont_close_one_hdl, &arg, 0); + + /* + * The container might be opened when the target is up, but changed to down when closing. + * We need to attempt to close down/downout targets regardless; it won't take any action + * if it was not opened before. Failure to properly close it will result in container + * destruction failing with EBUSY. (See DAOS-15514) + */ + return ds_pool_thread_collective(pool_uuid, 0, cont_close_one_hdl, &arg, 0); } struct xstream_cont_query {