From: Johannes Thumshirn Date: Fri, 21 Dec 2018 09:16:12 +0000 (+0100) Subject: common/config: create $RESULT_BASE before dumping kmemleak leaks X-Git-Tag: v2022.05.01~1311 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7fc034868d5dce9aaf3517c9c2197221b9a772e4;p=users%2Fhch%2Fxfstests-dev.git common/config: create $RESULT_BASE before dumping kmemleak leaks In _init_kmemleak() we're touching a check_kmemleak file in ${RESULT_BASE} if ${DEBUGFS_MNT/kmemleak} exists as a marker that we have to check for kmemleak output after running a test. In 'check' we're calling _init_kmemleak() at around 60% of the file, but ${RESULT_BASE} is created later at around 62% of the file, causing the 'touch' in _init_kmemleak() to fail. Create the ${RESULT_BASE} just after assigning the default value in get_next_config() [Eryu: check for mkdir failure and remove the $RESULT_BASE creation in check.] Signed-off-by: Johannes Thumshirn Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/check b/check index 59f94c1c3..3de1f0867 100755 --- a/check +++ b/check @@ -534,13 +534,6 @@ for section in $HOST_OPTIONS_SECTIONS; do fi fi - mkdir -p $RESULT_BASE - if [ ! -d $RESULT_BASE ]; then - echo "failed to create results directory $RESULT_BASE" - status=1 - exit - fi - if $OPTIONS_HAVE_SECTIONS; then echo "SECTION -- $section" fi diff --git a/common/config b/common/config index a87cb4a2b..0f153412b 100644 --- a/common/config +++ b/common/config @@ -657,6 +657,11 @@ get_next_config() { # set default RESULT_BASE if [ -z "$RESULT_BASE" ]; then export RESULT_BASE="$here/results/" + mkdir -p ${RESULT_BASE} + if [ ! -d ${RESULT_BASE} ]; then + echo "failed to create results directory $RESULT_BASE" + exit 1 + fi fi if [ "$FSTYP" == "tmpfs" ]; then