Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ XXX

* Version X.X.X

- Expand the sds.at_create CTL to also cover the POOL_FEAT_CHECK_BAD_BLOCKS feature (daos-stack/pmdk#28, DAOS-18296).
- Until now, it controlled only the POOL_FEAT_SDS feature, but both may use NDCTL calls and increase stack usage.
- Fix an issue in the PMEMOBJ allocator with a potential to corrupt the allocator's metadata (daos-stack/pmdk#24, DAOS-18195).
- Fix compilation error on LoongArch. Thank you @liuxiang88 and @bgermann for your persistence in making it happen! (daos-stack/pmdk#29, pmem/pmdk#5957).

Expand Down
4 changes: 4 additions & 0 deletions src/common/set.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2015-2024, Intel Corporation */
/* Copyright 2025, Hewlett Packard Enterprise Development LP */
/*
* Copyright (c) 2016, Microsoft Corporation. All rights reserved.
*
Expand Down Expand Up @@ -3042,6 +3043,9 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize,
goto err_poolset_free;
}

/* filter out unsupported or turned off features */
compat_features &= attr->features.compat;

if (compat_features & POOL_FEAT_CHECK_BAD_BLOCKS) {
/* check if any bad block recovery file exists */
int bfe = badblocks_recovery_file_exists(set);
Expand Down
1 change: 1 addition & 0 deletions src/libpmemobj/obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ pool_attr_adjust(struct pool_attr *attr)
}
} else {
attr->features.incompat &= ~POOL_FEAT_SDS; /* off */
attr->features.compat &= ~POOL_FEAT_CHECK_BAD_BLOCKS; /* off */
}

return 0;
Expand Down
4 changes: 4 additions & 0 deletions src/test/obj_pool/TEST32
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2019, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP

#
# src/test/obj_pool/TEST32 -- unit test for pmemobj_open
Expand All @@ -10,6 +11,9 @@
. ../unittest/unittest.sh

require_test_type medium
# For non-pmem POOL_FEAT_CHECK_BAD_BLOCKS is turned off via PMEMOBJ_CONF="sds.at_create=0"
require_real_pmem
require_sds ./obj_pool

setup

Expand Down
4 changes: 4 additions & 0 deletions src/test/obj_pool/TEST33
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2019, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP

#
# src/test/obj_pool/TEST33 -- unit test for pmemobj_open
Expand All @@ -10,6 +11,9 @@
. ../unittest/unittest.sh

require_test_type medium
# For non-pmem POOL_FEAT_CHECK_BAD_BLOCKS is turned off via PMEMOBJ_CONF="sds.at_create=0"
require_real_pmem
require_sds ./obj_pool

setup

Expand Down
5 changes: 2 additions & 3 deletions src/test/pmempool_sync/TEST32
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST32 -- test for sync command
Expand All @@ -12,8 +13,8 @@

. ../unittest/unittest.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
require_linked_with_ndctl $PMEMPOOL$EXESUFFIX

Expand All @@ -35,8 +36,6 @@ expect_normal_exit $PMEMPOOL$EXESUFFIX create obj --layout pmempool$SUFFIX $POOL

expect_normal_exit "$OBJ_VERIFY$EXESUFFIX $POOLSET pmempool$SUFFIX c v &>> $LOG"

turn_on_checking_bad_blocks $POOLSET

# zero blocks: offset: 2 length: 250
zero_blocks $DIR/testfile0 2 250

Expand Down
3 changes: 2 additions & 1 deletion src/test/pmempool_sync/TEST33
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST33 -- test for sync command
Expand All @@ -12,8 +13,8 @@

. ../unittest/unittest.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
require_linked_with_ndctl $PMEMPOOL$EXESUFFIX

Expand Down
3 changes: 2 additions & 1 deletion src/test/pmempool_sync/TEST34
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST34 -- test for sync command
Expand All @@ -14,8 +15,8 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
require_linked_with_ndctl $PMEMPOOL$EXESUFFIX

Expand Down
3 changes: 2 additions & 1 deletion src/test/pmempool_sync/TEST35
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST35 -- test for sync command
Expand All @@ -14,8 +15,8 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
require_linked_with_ndctl $PMEMPOOL$EXESUFFIX

Expand Down
3 changes: 2 additions & 1 deletion src/test/pmempool_sync/TEST36
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST36 -- test for sync command
Expand All @@ -15,8 +16,8 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
require_linked_with_ndctl $PMEMPOOL$EXESUFFIX

Expand Down
3 changes: 2 additions & 1 deletion src/test/pmempool_sync/TEST37
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025-2026, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST37 -- test for sync command
Expand All @@ -15,8 +16,8 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
require_linked_with_ndctl $PMEMPOOL$EXESUFFIX

Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST43
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST43 -- test for sync command with badblocks
Expand All @@ -11,6 +12,7 @@

. ../unittest/unittest.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST44
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST44 -- test for sync command with badblocks
Expand All @@ -16,6 +17,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST45
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST45 -- test for sync command with badblocks
Expand All @@ -14,6 +15,7 @@

. ../unittest/unittest.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST46
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST46 -- test for sync command with badblocks
Expand All @@ -14,6 +15,7 @@

. ../unittest/unittest.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST47
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST47 -- test for sync command with badblocks
Expand All @@ -15,6 +16,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST48
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST48 -- test for sync command with badblocks
Expand All @@ -18,6 +19,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST49
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2011-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST49 -- test for sync command with badblocks
Expand All @@ -19,6 +20,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST50
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST50 -- test for sync command with badblocks
Expand All @@ -19,6 +20,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST51
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST51 -- test for sync command with badblocks
Expand All @@ -20,6 +21,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST52
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST52 -- test for sync command with badblocks
Expand All @@ -15,6 +16,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
2 changes: 2 additions & 0 deletions src/test/pmempool_sync/TEST53
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2011-2024, Intel Corporation
# Copyright 2025, Hewlett Packard Enterprise Development LP
#
#
# pmempool_sync/TEST53 -- test for sync command with badblocks
Expand All @@ -17,6 +18,7 @@

. setup.sh

require_real_pmem
require_test_type medium
require_fs_type non-pmem
require_build_type debug nondebug
Expand Down
22 changes: 22 additions & 0 deletions src/test/unittest/unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2610,3 +2610,25 @@ function set_test_labels() {
verbose_msg "$UNITTEST_NAME: SKIP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM) test-labels: $* ($TEST_LABEL required)"
exit 0
}

#
# require_real_pmem -- run tests only on real pmem
#
function require_real_pmem() {
local path="$1"
if [ -z "$path" ]; then
path="$DIR"
fi
if [ "$PMEM_IS_PMEM_FORCE" == "1" ]; then
verbose_msg "$UNITTEST_NAME: SKIP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM) PMEM is forced (PMEM_IS_PMEM_FORCE=$PMEM_IS_PMEM_FORCE), real PMEM required"
exit 0
fi
case "$REAL_FS" in
pmem)
;;
*)
verbose_msg "$UNITTEST_NAME: SKIP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM) REAL_FS $REAL_FS (pmem required)"
exit 0
;;
esac
}
Loading
Loading