From 3f0737b43a2f8adad45e92a09978f87d76e4bd46 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 Cherry-pick of to release/2.4 branch, a fix for Coverity CID 1444801 Required-githooks: true Signed-off-by: Kenneth Cain --- src/cart/crt_self_test_client.c | 2 +- src/client/kv/dc_kv.c | 2 +- src/control/cmd/daos_agent/fabric.go | 2 +- src/control/lib/spdk/spdk.go | 2 +- src/control/lib/spdk/spdk_default.go | 2 +- src/gurt/dlog.c | 2 +- src/pool/cli.c | 8 ++++++-- src/tests/ftest/datamover/serial_small.py | 2 +- src/tests/suite/daos_kv.c | 2 +- 9 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/cart/crt_self_test_client.c b/src/cart/crt_self_test_client.c index 71ab7a6d3cff..33aa437714f8 100644 --- a/src/cart/crt_self_test_client.c +++ b/src/cart/crt_self_test_client.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2016-2022 Intel Corporation. + * (C) Copyright 2016-2023 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ diff --git a/src/client/kv/dc_kv.c b/src/client/kv/dc_kv.c index 3924c48c04b7..da1f31b94547 100644 --- a/src/client/kv/dc_kv.c +++ b/src/client/kv/dc_kv.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2017-2022 Intel Corporation. + * (C) Copyright 2017-2023 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ diff --git a/src/control/cmd/daos_agent/fabric.go b/src/control/cmd/daos_agent/fabric.go index d2f7870f47c5..ff05ecbf6fd2 100644 --- a/src/control/cmd/daos_agent/fabric.go +++ b/src/control/cmd/daos_agent/fabric.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2021-2022 Intel Corporation. +// (C) Copyright 2021-2023 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // diff --git a/src/control/lib/spdk/spdk.go b/src/control/lib/spdk/spdk.go index 062ac719ad90..fec4e29e3856 100644 --- a/src/control/lib/spdk/spdk.go +++ b/src/control/lib/spdk/spdk.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2018-2022 Intel Corporation. +// (C) Copyright 2018-2023 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // diff --git a/src/control/lib/spdk/spdk_default.go b/src/control/lib/spdk/spdk_default.go index 77f382f0268e..e501f957e88e 100644 --- a/src/control/lib/spdk/spdk_default.go +++ b/src/control/lib/spdk/spdk_default.go @@ -1,5 +1,5 @@ // -// (C) Copyright 2022 Intel Corporation. +// (C) Copyright 2022-2023 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // diff --git a/src/gurt/dlog.c b/src/gurt/dlog.c index 430ddbfbec7c..0b3d2335dd2d 100644 --- a/src/gurt/dlog.c +++ b/src/gurt/dlog.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2016-2022 Intel Corporation. + * (C) Copyright 2016-2023 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ diff --git a/src/pool/cli.c b/src/pool/cli.c index 37219efedd03..e5ea11684d66 100644 --- a/src/pool/cli.c +++ b/src/pool/cli.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2016-2022 Intel Corporation. + * (C) Copyright 2016-2023 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -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); diff --git a/src/tests/ftest/datamover/serial_small.py b/src/tests/ftest/datamover/serial_small.py index afae5e76451b..bea026551209 100644 --- a/src/tests/ftest/datamover/serial_small.py +++ b/src/tests/ftest/datamover/serial_small.py @@ -1,5 +1,5 @@ ''' - (C) Copyright 2020-2022 Intel Corporation. + (C) Copyright 2020-2023 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' diff --git a/src/tests/suite/daos_kv.c b/src/tests/suite/daos_kv.c index 701c5cc2edea..b5910d0a2829 100644 --- a/src/tests/suite/daos_kv.c +++ b/src/tests/suite/daos_kv.c @@ -1,5 +1,5 @@ /** - * (C) Copyright 2016-2022 Intel Corporation. + * (C) Copyright 2016-2023 Intel Corporation. * * SPDX-License-Identifier: BSD-2-Clause-Patent */