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
Cherry-pick of to release/2.4 branch, a 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 702c989 commit 3f0737b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cart/crt_self_test_client.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2022 Intel Corporation.
* (C) Copyright 2016-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down
2 changes: 1 addition & 1 deletion src/client/kv/dc_kv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2017-2022 Intel Corporation.
* (C) Copyright 2017-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down
2 changes: 1 addition & 1 deletion src/control/cmd/daos_agent/fabric.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2021-2022 Intel Corporation.
// (C) Copyright 2021-2023 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down
2 changes: 1 addition & 1 deletion src/control/lib/spdk/spdk.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2018-2022 Intel Corporation.
// (C) Copyright 2018-2023 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down
2 changes: 1 addition & 1 deletion src/control/lib/spdk/spdk_default.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// (C) Copyright 2022 Intel Corporation.
// (C) Copyright 2022-2023 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
Expand Down
2 changes: 1 addition & 1 deletion src/gurt/dlog.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2022 Intel Corporation.
* (C) Copyright 2016-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down
8 changes: 6 additions & 2 deletions src/pool/cli.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2022 Intel Corporation.
* (C) Copyright 2016-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down 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
2 changes: 1 addition & 1 deletion src/tests/ftest/datamover/serial_small.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
(C) Copyright 2020-2022 Intel Corporation.
(C) Copyright 2020-2023 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
Expand Down
2 changes: 1 addition & 1 deletion src/tests/suite/daos_kv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright 2016-2022 Intel Corporation.
* (C) Copyright 2016-2023 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down

0 comments on commit 3f0737b

Please sign in to comment.