Skip to content

Commit

Permalink
DAOS-13786 client: pool_free take rdlock for dp_co_list check
Browse files Browse the repository at this point in the history
Fix for Coverity CID 1444801

Required-githooks: true

Signed-off-by: Kenneth Cain <kenneth.c.cain@intel.com>
  • Loading branch information
kccain committed Jun 21, 2023
1 parent 4b2b545 commit 4f6afdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pool/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4f6afdf

Please sign in to comment.