From 4f6afdf31797d9d5f0a8271ce8fac8328d7a7d7e Mon Sep 17 00:00:00 2001 From: Kenneth Cain Date: Wed, 21 Jun 2023 11:49:45 -0400 Subject: [PATCH] DAOS-13786 client: pool_free take rdlock for dp_co_list check Fix for Coverity CID 1444801 Required-githooks: true Signed-off-by: Kenneth Cain --- src/pool/cli.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pool/cli.c b/src/pool/cli.c index 37219efedd0..98eb3040ccd 100644 --- a/src/pool/cli.c +++ b/src/pool/cli.c @@ -87,10 +87,14 @@ pool_free(struct d_hlink *hlink) pool = container_of(hlink, struct dc_pool, dp_hlink); D_ASSERT(daos_hhash_link_empty(&pool->dp_hlink)); + + D_RWLOCK_RDLOCK(&pool->dp_co_list_lock); + D_ASSERT(d_list_empty(&pool->dp_co_list)); + D_RWLOCK_UNLOCK(&pool->dp_co_list_lock); + D_RWLOCK_DESTROY(&pool->dp_map_lock); D_MUTEX_DESTROY(&pool->dp_client_lock); D_RWLOCK_DESTROY(&pool->dp_co_list_lock); - D_ASSERT(d_list_empty(&pool->dp_co_list)); if (pool->dp_map != NULL) pool_map_decref(pool->dp_map);