diff --git a/ChangeLog b/ChangeLog index d988ad2798d968f7529b427ef6f4218f0c57e71a..c09993f27b1c833257717b1c16053c31a147fe6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Tue Feb 19 2018 Marcin Åšlusarz <marcin.slusarz@intel.com> + + * Version 1.5.1 + + This release fixes minor bugs and improves compatibility with newer + tool chains. + + Notable bug fixes: + - common: make detection of device-dax instances more robust + - obj: fix pmemobj_check for pools with some sizes + - obj: don't use anon struct in an union (public header) + - obj: fix pmemobj_tx_lock error handling + - obj: don't use braces in an expression with clang (public header) + - obj: suppress pmemcheck warnings for statistics + - pmreorder: fix markers nontype issue + Fri Oct 26 2018 Marcin Åšlusarz <marcin.slusarz@intel.com> * Version 1.5 @@ -20,9 +36,11 @@ Fri Oct 26 2018 Marcin Åšlusarz <marcin.slusarz@intel.com> - pmreorder: new tool for verification of persistent memory algorithms - obj: new on media layout - pmem/obj: new flexible memcpy|memmove|memset API - - obj: new flushing APIs: pmemobj_xpersist, pmemobj_xflush (PMEMOBJ_F_RELAXED) + - obj: new flushing APIs: pmemobj_xpersist, pmemobj_xflush + (PMEMOBJ_F_RELAXED) - rpmem: new flag RPMEM_PERSIST_RELAXED for rpmem_persist - - obj: lazily initialized volatile variables (pmemobj_volatile) (EXPERIMENTAL) + - obj: lazily initialized volatile variables (pmemobj_volatile) + (EXPERIMENTAL) - obj: allocation classes with alignment - obj: new action APIs: pmemobj_defer_free, POBJ_XRESERVE_NEW, POBJ_XRESERVE_ALLOC diff --git a/src/common/set.c b/src/common/set.c index 008f369b48196996843a828b9f8b0c887e6fe1bc..590421a145b47ab52e82ac4924921f767175a6b4 100644 --- a/src/common/set.c +++ b/src/common/set.c @@ -1431,12 +1431,14 @@ util_poolset_directories_load(struct pool_set *set) */ struct pool_replica *rep; struct pool_replica *mrep = set->replica[max_parts_rep]; + for (unsigned r = 0; r < set->nreplicas; r++) { if (set->replica[r]->nparts == mrep->nparts) continue; if (VEC_SIZE(&set->replica[r]->directory) == 0) { - ERR("no directories in replica"); + errno = ENOENT; + ERR("!no directories in replica"); return -1; } @@ -3912,6 +3914,12 @@ util_pool_open(struct pool_set **setp, const char *path, size_t minpartsize, return -1; } + if ((*setp)->replica[0]->nparts == 0) { + errno = ENOENT; + ERR("!no parts in replicas"); + return -1; + } + if (cow && (*setp)->replica[0]->part[0].is_dev_dax) { ERR("device dax cannot be mapped privately"); errno = ENOTSUP; diff --git a/src/include/libpmem.h b/src/include/libpmem.h index 0175ad56934cebb95583150012e90e61855244c1..60902743581f923fe0ba743553b5aa7b1b2f93c3 100644 --- a/src/include/libpmem.h +++ b/src/include/libpmem.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018, Intel Corporation + * Copyright 2014-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,8 @@ #ifndef LIBPMEM_H #define LIBPMEM_H 1 +#include <sys/types.h> + #ifdef _WIN32 #include <pmemcompat.h> @@ -62,8 +64,6 @@ extern "C" { #endif -#include <sys/types.h> - /* * This limit is set arbitrary to incorporate a pool header and required * alignment plus supply. diff --git a/src/include/libpmemblk.h b/src/include/libpmemblk.h index 6b7dd736b1793b0d4676073b19a612867e926596..232f821cc7c248aadc054eb9e6e019df4feb4e05 100644 --- a/src/include/libpmemblk.h +++ b/src/include/libpmemblk.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018, Intel Corporation + * Copyright 2014-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,8 @@ #ifndef LIBPMEMBLK_H #define LIBPMEMBLK_H 1 +#include <sys/types.h> + #ifdef _WIN32 #include <pmemcompat.h> @@ -72,8 +74,6 @@ extern "C" { #endif -#include <sys/types.h> - /* * opaque type, internal to libpmemblk */ diff --git a/src/include/libpmemlog.h b/src/include/libpmemlog.h index e3de673fe79e80a94bc2561058487606332be97b..f608582a56c173c48ed72fa95f64a06b633ce181 100644 --- a/src/include/libpmemlog.h +++ b/src/include/libpmemlog.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018, Intel Corporation + * Copyright 2014-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +43,8 @@ #ifndef LIBPMEMLOG_H #define LIBPMEMLOG_H 1 +#include <sys/types.h> + #ifdef _WIN32 #include <pmemcompat.h> @@ -74,8 +76,6 @@ extern "C" { #endif -#include <sys/types.h> - /* * opaque type, internal to libpmemlog */ diff --git a/src/include/libpmempool.h b/src/include/libpmempool.h index 9f14bd025994717e66f8ed5a29d31ac19a358564..144601feec28573ad63d210b1515f9dc60560c99 100644 --- a/src/include/libpmempool.h +++ b/src/include/libpmempool.h @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018, Intel Corporation + * Copyright 2016-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -39,6 +39,10 @@ #ifndef LIBPMEMPOOL_H #define LIBPMEMPOOL_H 1 +#include <stdint.h> +#include <stddef.h> +#include <limits.h> + #ifdef _WIN32 #include <pmemcompat.h> @@ -78,11 +82,6 @@ extern "C" { #endif -#include <stdint.h> -#include <stddef.h> -#include <limits.h> - - /* PMEMPOOL CHECK */ /* diff --git a/src/include/librpmem.h b/src/include/librpmem.h index 8c102bc92d5791abb7253c1288308829dd95863e..b9fb26143d4a9f1c5fe821cb097a64aac466c286 100644 --- a/src/include/librpmem.h +++ b/src/include/librpmem.h @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018, Intel Corporation + * Copyright 2016-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,13 +42,13 @@ #ifndef LIBRPMEM_H #define LIBRPMEM_H 1 +#include <sys/types.h> +#include <stdint.h> + #ifdef __cplusplus extern "C" { #endif -#include <sys/types.h> -#include <stdint.h> - typedef struct rpmem_pool RPMEMpool; #define RPMEM_POOL_HDR_SIG_LEN 8 diff --git a/src/include/libvmem.h b/src/include/libvmem.h index e39cdbbb2b6b4bc9cb42fd8b9d5cf9599c5af9f7..d9d841397280ddf0ad787148c56a84aa47e615ae 100644 --- a/src/include/libvmem.h +++ b/src/include/libvmem.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017, Intel Corporation + * Copyright 2014-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,6 +41,9 @@ #ifndef LIBVMEM_H #define LIBVMEM_H 1 +#include <sys/types.h> +#include <stddef.h> + #ifdef _WIN32 #ifndef PMDK_UTF8_API #define vmem_create vmem_createW @@ -57,9 +60,6 @@ extern "C" { #endif -#include <sys/types.h> -#include <stddef.h> - typedef struct vmem VMEM; /* opaque type internal to libvmem */ /* diff --git a/src/include/libvmmalloc.h b/src/include/libvmmalloc.h index 36d776c04d3074c16c10f069346d4a43720fa4fc..4afcb6a18818228264e64f1198d587e5467a3bbe 100644 --- a/src/include/libvmmalloc.h +++ b/src/include/libvmmalloc.h @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017, Intel Corporation + * Copyright 2014-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,6 +41,8 @@ #ifndef LIBVMMALLOC_H #define LIBVMMALLOC_H 1 +#include <sys/types.h> + #ifdef __cplusplus extern "C" { #endif @@ -48,8 +50,6 @@ extern "C" { #define VMMALLOC_MAJOR_VERSION 1 #define VMMALLOC_MINOR_VERSION 1 -#include <sys/types.h> - #define VMMALLOC_MIN_POOL ((size_t)(1024 * 1024 * 14)) /* min pool size: 14MB */ /* diff --git a/src/test/pmempool_info/TEST18w.PS1 b/src/test/pmempool_info/TEST18w.PS1 index e2213cd7cd36099c9396035fc02c6aad42d33e66..77eff40d8efa5747ed05fb6686dbd86498286a5a 100644 --- a/src/test/pmempool_info/TEST18w.PS1 +++ b/src/test/pmempool_info/TEST18w.PS1 @@ -1,5 +1,5 @@ # -# Copyright 2018, Intel Corporation +# Copyright 2018-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -44,14 +44,12 @@ setup $POOL="$DIR\file.pool" $LOG="out$Env:UNITTEST_NUM.log" $ERR="err$Env:UNITTEST_NUM.log" -rm $LOG -Force -ea si -rm $ERR -Force -ea si expect_normal_exit $PMEMPOOL create blk 512 $POOL -&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x01" "pool_hdr.checksum_gen()" >> $LOG -expect_abnormal_exit $PMEMPOOL info $POOL >> $LOG 2>$ERR -&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x00" "pool_hdr.checksum_gen()" >> $LOG -expect_normal_exit $PMEMPOOL info $POOL >> $LOG +&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x01" "pool_hdr.checksum_gen()" | out-file -Encoding ascii $LOG +expect_abnormal_exit cmd /c $PMEMPOOL info $POOL `>`> $LOG 2`>$ERR +&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x00" "pool_hdr.checksum_gen()" | out-file -Append -Encoding ascii $LOG +expect_normal_exit $PMEMPOOL info $POOL | out-file -Append -Encoding ascii $LOG check diff --git a/src/test/pmempool_info/TEST19w.PS1 b/src/test/pmempool_info/TEST19w.PS1 index 5bc887f5e6b4b5594be8fded3326feceae860bf0..c21d77de2495572e04c1c4f16f0a4e63ea22164d 100644 --- a/src/test/pmempool_info/TEST19w.PS1 +++ b/src/test/pmempool_info/TEST19w.PS1 @@ -1,5 +1,5 @@ # -# Copyright 2018, Intel Corporation +# Copyright 2018-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -44,14 +44,12 @@ setup $POOL="$DIR\file.pool" $LOG="out$Env:UNITTEST_NUM.log" $ERR="err$Env:UNITTEST_NUM.log" -rm $LOG -Force -ea si -rm $ERR -Force -ea si expect_normal_exit $PMEMPOOL create log $POOL -&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x01" "pool_hdr.checksum_gen()" >> $LOG -expect_abnormal_exit $PMEMPOOL info $POOL >> $LOG 2>$ERR -&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x00" "pool_hdr.checksum_gen()" >> $LOG -expect_normal_exit $PMEMPOOL info $POOL >> $LOG +&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x01" "pool_hdr.checksum_gen()" | out-file -Encoding ascii $LOG +expect_abnormal_exit cmd /c $PMEMPOOL info $POOL `>`> $LOG 2`>$ERR +&$PMEMSPOIL -v $POOL "pool_hdr.features.compat=0x00" "pool_hdr.checksum_gen()" | out-file -Append -Encoding ascii $LOG +expect_normal_exit $PMEMPOOL info $POOL | out-file -Append -Encoding ascii $LOG check diff --git a/src/test/pmempool_info/err18w.log.match b/src/test/pmempool_info/err18w.log.match index 04293a72916fa16b8166d0f2402f502f76f5b1bc..a5a83fc7e73dc02a3e294a6e7cac956a8f4d0965 100644 --- a/src/test/pmempool_info/err18w.log.match +++ b/src/test/pmempool_info/err18w.log.match @@ -1,8 +1 @@ -$(nW)pmempool.exe : error: Unable to retrieve badblock info -At line:$(N) char:$(N) -+ $(nW)pmempool.exe 'info' $(*) -$(*) -$(*)(error: Unable to retrieve badblock info:String)$(*) -$(*) -$(*) -$(OPT)$(*) +error: Unable to retrieve badblock info diff --git a/src/test/pmempool_info/err19w.log.match b/src/test/pmempool_info/err19w.log.match index 04293a72916fa16b8166d0f2402f502f76f5b1bc..a5a83fc7e73dc02a3e294a6e7cac956a8f4d0965 100644 --- a/src/test/pmempool_info/err19w.log.match +++ b/src/test/pmempool_info/err19w.log.match @@ -1,8 +1 @@ -$(nW)pmempool.exe : error: Unable to retrieve badblock info -At line:$(N) char:$(N) -+ $(nW)pmempool.exe 'info' $(*) -$(*) -$(*)(error: Unable to retrieve badblock info:String)$(*) -$(*) -$(*) -$(OPT)$(*) +error: Unable to retrieve badblock info diff --git a/src/test/rpmem_addr_ext/node_1_rpmem0.log.match b/src/test/rpmem_addr_ext/node_1_rpmem0.log.match index 0ef28276445f4a6646df6e660afa668ba50fdc55..2d79ed43d08bf5d7dd9da644823cc6b3e94bb2a7 100644 --- a/src/test/rpmem_addr_ext/node_1_rpmem0.log.match +++ b/src/test/rpmem_addr_ext/node_1_rpmem0.log.match @@ -7,7 +7,7 @@ $(OPT)<librpmem>: <1> [$(*)] compiled with support for Valgrind memcheck $(OPT)<librpmem>: <1> [$(*)] compiled with support for Valgrind drd $(OPT)<librpmem>: <1> [$(*)] compiled with support for shutdown state $(OPT)<librpmem>: <1> [$(*)] compiled with libndctl 63+ -<librpmem>: <3> [$(*)] +<librpmem>: <3> [$(*)] <librpmem>: <3> [$(*)] Libfabric is fork safe $(OPT)<librpmem>: <3> [$(*)] $(*) $(OPT)<librpmem>: <3> [$(*)] $(*) diff --git a/src/test/util_poolset/TEST4 b/src/test/util_poolset/TEST4 index 1ad4c7de79a0b1abda521ddeac72d68fe8af2e55..01f626feae3406dcb9e5a08a852bdc68b3911f66 100755 --- a/src/test/util_poolset/TEST4 +++ b/src/test/util_poolset/TEST4 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -45,6 +45,8 @@ setup RESVSIZE=$((4 * 1024 * 1024 * 1024)) # 4GiB MIN_POOL=$((128 * 1024 * 1024)) # 128MiB +require_free_space $(( $MIN_POOL * 12 )) + export TEST_LOG_LEVEL=4 export TEST_LOG_FILE=./test$UNITTEST_NUM.log diff --git a/src/test/util_poolset/TEST4w.PS1 b/src/test/util_poolset/TEST4w.PS1 index 56925173e411b76c95164b406f15b530acfcd998..0f4be2b6f28d574ece65b0d12f9af09367748100 100644 --- a/src/test/util_poolset/TEST4w.PS1 +++ b/src/test/util_poolset/TEST4w.PS1 @@ -1,5 +1,5 @@ # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -50,6 +50,9 @@ $MIN_POOL_STR = ${MIN_POOL}.toString() + "B" # 128MiB $RESVSIZE=4 * 1024 * 1024 * 1024 # 4GiB $RESVSIZE_STR = ${RESVSIZE}.toString() + "B" # 4GiB +$REQUIRE_POOL = ${MIN_POOL} * 12 +require_free_space "${REQUIRE_POOL}b" + create_poolset $DIR\testset1 ` ${RESVSIZE_STR}:$DIR\testdir11:d ` O SINGLEHDR diff --git a/src/test/util_poolset/TEST5 b/src/test/util_poolset/TEST5 index 9930819b8c7100739c91f2e3f9b5841bbadbcc12..74b6a429e10a17de420e78a46cd75548271b18be 100755 --- a/src/test/util_poolset/TEST5 +++ b/src/test/util_poolset/TEST5 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -45,6 +45,8 @@ setup RESVSIZE=$(((128 + 4) * 1024 * 1024)) MIN_POOL=$((128 * 1024 * 1024)) +require_free_space $(( $MIN_POOL * 15 )) + export TEST_LOG_LEVEL=4 export TEST_LOG_FILE=./test$UNITTEST_NUM.log @@ -72,7 +74,6 @@ expect_normal_exit ./util_poolset$EXESUFFIX c $MIN_POOL\ $DIR/testset2\ $DIR/testset3\ $DIR/testset4\ - $DIR/testset4\ $DIR/testset9 # now check if pool sets may be opened diff --git a/src/test/util_poolset/TEST5w.PS1 b/src/test/util_poolset/TEST5w.PS1 index 71c4838a3a54e2c323918d76b86363a8ea04dc80..5925cfc3666b64d1990787522b87ed9931e5ba3d 100644 --- a/src/test/util_poolset/TEST5w.PS1 +++ b/src/test/util_poolset/TEST5w.PS1 @@ -1,5 +1,5 @@ # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -50,6 +50,9 @@ $MIN_POOL_STR = ${MIN_POOL}.toString() + "B" # 128MiB $RESVSIZE=(128 + 4) * 1024 * 1024 # initial part + extension $RESVSIZE_STR = ${RESVSIZE}.toString() + "B" # initial part + extension +$REQUIRE_POOL = ${MIN_POOL} * 15 +require_free_space "${REQUIRE_POOL}b" + create_poolset $DIR\testset1 ` ${RESVSIZE_STR}:$DIR\testdir11:d ` O SINGLEHDR diff --git a/src/test/util_poolset/TEST6 b/src/test/util_poolset/TEST6 index 8feb1c4e23463b5e026b242aa0606bf54aea512b..60a296ab4b68450cab98b18b4e2ceb53dc85bcc8 100755 --- a/src/test/util_poolset/TEST6 +++ b/src/test/util_poolset/TEST6 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -45,6 +45,8 @@ setup RESVSIZE=$((260 * 1024 * 1024)) # 264MiB (base part + 2 extends) MIN_POOL=$((128 * 1024 * 1024)) # 128MiB +require_free_space $(( $MIN_POOL * 8 )) + export TEST_LOG_LEVEL=4 export TEST_LOG_FILE=./test$UNITTEST_NUM.log diff --git a/src/test/util_poolset/TEST6w.PS1 b/src/test/util_poolset/TEST6w.PS1 index 07f43ce7e8d9718488a3208669a0b8dd37a6bed8..9e78544b61f6f43a249251d36816846574971683 100644 --- a/src/test/util_poolset/TEST6w.PS1 +++ b/src/test/util_poolset/TEST6w.PS1 @@ -1,5 +1,5 @@ # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -50,6 +50,9 @@ $MIN_POOL_STR = ${MIN_POOL}.toString() + "B" # 128MiB $RESVSIZE=260 * 1024 * 1024 # 260 MiB $RESVSIZE_STR = ${RESVSIZE}.toString() + "B" # 260 MiB +$REQUIRE_POOL = ${MIN_POOL} * 8 +require_free_space "${REQUIRE_POOL}b" + # prepare pool sets create_poolset $DIR\testset2 ` ${RESVSIZE_STR}:$DIR\testdir21:d ${RESVSIZE_STR}:$DIR\testfile22 diff --git a/src/test/util_poolset/TEST7 b/src/test/util_poolset/TEST7 index 06710e6114736259d042c39bb3a2f6f5172b7b0b..46d12b3c07b36935ce928438e4d26c89418c17c3 100755 --- a/src/test/util_poolset/TEST7 +++ b/src/test/util_poolset/TEST7 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2017-2018, Intel Corporation +# Copyright 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -47,6 +47,8 @@ setup RESVSIZE=$((4 * 1024 * 1024 * 1024)) # 4GiB MIN_POOL=$((128 * 1024 * 1024)) # 128MiB +require_free_space $(( $MIN_POOL * 6 )) + export TEST_LOG_LEVEL=4 export TEST_LOG_FILE=./test$UNITTEST_NUM.log diff --git a/src/test/util_poolset/TEST8 b/src/test/util_poolset/TEST8 new file mode 100755 index 0000000000000000000000000000000000000000..7be610e4767ea34c042e09d55f04f20b9119575b --- /dev/null +++ b/src/test/util_poolset/TEST8 @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# +# Copyright 2019, Intel Corporation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# +# src/test/util_poolset/TEST8 -- unit test for util_pool_open() +# + +# standard unit test setup +. ../unittest/unittest.sh + +require_test_type medium +require_fs_type any + +setup + +RESVSIZE=$(((128 + 4) * 1024 * 1024)) +MIN_POOL=$((128 * 1024 * 1024)) + +export TEST_LOG_LEVEL=8 +export TEST_LOG_FILE=./test$UNITTEST_NUM.log + +# prepare pool sets +create_poolset $DIR/testset1\ + $RESVSIZE:$DIR/testdir11:d\ + O SINGLEHDR # pass +create_poolset $DIR/testset2\ + $RESVSIZE:$DIR/testdir21:d $RESVSIZE:$DIR/testdir22:d\ + O SINGLEHDR # pass +create_poolset $DIR/testset3\ + $RESVSIZE:$DIR/testdir31:d R $RESVSIZE:$DIR/testdir32:d\ + O SINGLEHDR # pass +create_poolset $DIR/testset4\ + $RESVSIZE:$DIR/testdir41:d $RESVSIZE:$DIR/testdir42:d\ + R $RESVSIZE:$DIR/testdir43:d $RESVSIZE:$DIR/testdir44:d\ + O SINGLEHDR # pass +create_poolset $DIR/testset9\ + $RESVSIZE:$DIR/testdir91:d R $RESVSIZE:$DIR/testdir91/testdir92:d\ + O SINGLEHDR # pass + +# should fail to open +expect_normal_exit ./util_poolset$EXESUFFIX o $MIN_POOL\ + $DIR/testset1\ + $DIR/testset2\ + $DIR/testset3\ + $DIR/testset4\ + $DIR/testset9 + +$GREP "<1>" $TEST_LOG_FILE | sed -e "s/^.*\][ ]*//g" > ./grep$UNITTEST_NUM.log + +check + +pass diff --git a/src/test/util_poolset/out8.log.match b/src/test/util_poolset/out8.log.match new file mode 100644 index 0000000000000000000000000000000000000000..041541f70b5c29f116aa9ba9dcb444d16fc621e0 --- /dev/null +++ b/src/test/util_poolset/out8.log.match @@ -0,0 +1,8 @@ +util_poolset$(nW)TEST8: START: util_poolset + ./util_poolset$(nW) o 134217728 $(nW)testset1 $(nW)testset2 $(nW)testset3 $(nW)testset4 $(nW)testset9 +$(nW)testset1: util_pool_open: No such file or directory +$(nW)testset2: util_pool_open: No such file or directory +$(nW)testset3: util_pool_open: No such file or directory +$(nW)testset4: util_pool_open: No such file or directory +$(nW)testset9: util_pool_open: No such file or directory +util_poolset$(nW)TEST8: DONE diff --git a/src/test/vmmalloc_fork/TEST1 b/src/test/vmmalloc_fork/TEST1 index c1a6dda4f5eb5dde9f2ff1fcfca7a243f8a43dde..ad8d45337fa431390d6434f938e1b5c37185b9d9 100755 --- a/src/test/vmmalloc_fork/TEST1 +++ b/src/test/vmmalloc_fork/TEST1 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2015-2018, Intel Corporation +# Copyright 2015-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -52,6 +52,9 @@ configure_valgrind drd force-disable setup +# VMMALLOC_POOL_SIZE * 2^argv[2] +require_free_space 1G + export VMMALLOC_POOL_SIZE=$((64 * 1024 * 1024)) export VMMALLOC_LOG_LEVEL=3 export VMMALLOC_FORK=1 diff --git a/src/test/vmmalloc_fork/TEST2 b/src/test/vmmalloc_fork/TEST2 index 75c879e24738f57173402edc456e3ef58ee3eba0..7433dadda6a60866f4ed57464e8c8ba8c85b7621 100755 --- a/src/test/vmmalloc_fork/TEST2 +++ b/src/test/vmmalloc_fork/TEST2 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2015-2018, Intel Corporation +# Copyright 2015-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -52,6 +52,9 @@ configure_valgrind drd force-disable setup +# VMMALLOC_POOL_SIZE * 2^argv[2] +require_free_space 1G + # Must be defined before require_preload export VMMALLOC_POOL_SIZE=$((64 * 1024 * 1024)) export VMMALLOC_LOG_LEVEL=3 diff --git a/src/test/vmmalloc_fork/TEST3 b/src/test/vmmalloc_fork/TEST3 index a22a7d9790e423c04fbbe515aabdff25b03e762e..d57fcdc87b91cf5d7c0c1cb7c912aaf6c790f733 100755 --- a/src/test/vmmalloc_fork/TEST3 +++ b/src/test/vmmalloc_fork/TEST3 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2015-2018, Intel Corporation +# Copyright 2015-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -52,6 +52,9 @@ configure_valgrind drd force-disable setup +# VMMALLOC_POOL_SIZE * 2^argv[2] +require_free_space 1G + export VMMALLOC_POOL_SIZE=$((64 * 1024 * 1024)) export VMMALLOC_LOG_LEVEL=3 export VMMALLOC_FORK=1 diff --git a/src/test/vmmalloc_fork/TEST4 b/src/test/vmmalloc_fork/TEST4 index 6e1891683e240af4e4194f055928c164e79cf802..3194197f903fa4c4365109d01075f18dc6d97069 100755 --- a/src/test/vmmalloc_fork/TEST4 +++ b/src/test/vmmalloc_fork/TEST4 @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright 2015-2018, Intel Corporation +# Copyright 2015-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -52,6 +52,9 @@ configure_valgrind drd force-disable setup +# VMMALLOC_POOL_SIZE * 2^argv[2] +require_free_space 1G + # Must be defined before require_preload export VMMALLOC_POOL_SIZE=$((64 * 1024 * 1024)) export VMMALLOC_LOG_LEVEL=3 diff --git a/src/tools/pmempool/info.c b/src/tools/pmempool/info.c index 13b985ba9c5db57082a2649f93ea2c3c8e61b6c0..f375823d19c2eddc875e6723d2ded6e0c7f45087 100644 --- a/src/tools/pmempool/info.c +++ b/src/tools/pmempool/info.c @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018, Intel Corporation + * Copyright 2014-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -568,7 +568,7 @@ pmempool_info_badblocks(struct pmem_info *pip, const char *file_name, int v) ret = os_badblocks_get(file_name, bbs); if (ret) { if (errno == ENOTSUP) { - outv(v, BB_NOT_SUPP); + outv(v, BB_NOT_SUPP "\n"); ret = -1; goto exit_free; } diff --git a/utils/librpmem.pc.in b/utils/librpmem.pc.in index 1f1bc57e7cdabe01403bb9fc2e396d8e2ac71112..6a5b46a4bc2d2e5238cb1447ae2815f697358c5d 100644 --- a/utils/librpmem.pc.in +++ b/utils/librpmem.pc.in @@ -5,5 +5,5 @@ Description: librpmem library from PMDK project Version: ${version} URL: http://pmem.io/pmdk Requires: -Libs: -L${libdir} -lpmem +Libs: -L${libdir} -lrpmem Cflags: -I${includedir} diff --git a/utils/pkg-common.sh b/utils/pkg-common.sh index 235757ce0b9a189e79a737ca109edeae796d6c5a..62854e585ed2d9b878d5d281320949d81c7d5609 100644 --- a/utils/pkg-common.sh +++ b/utils/pkg-common.sh @@ -1,5 +1,5 @@ # -# Copyright 2014-2018, Intel Corporation +# Copyright 2014-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -65,7 +65,7 @@ function check_tool() { } function get_version() { - echo -n $1 + echo -n $1 | sed "s/-rc/~rc/" } function get_os() {