From c0b4c5fb3fd0e946122c91dc80365aabe09a7ac3 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Tue, 1 Mar 2022 01:28:42 -0800 Subject: [PATCH] EX-4572 tests: fix setfattr stack_trap in init_hot_pools_env() This patch fixes setfattr stack_trap in init_hot_pools_env() to resolve the following error: /usr/lib64/lustre/tests/test-framework.sh: line 2: trusted.dmv=0xd00c......: command not found Test-Parameters: trivial testlist=hot-pools Test-Parameters: trivial mdscount=2 mdtcount=4 testlist=hot-pools Fixes: 7ff7b9d8cf0 ("EX-3640 test: mkdir on MDT0 in hot-pools.sh") Change-Id: Ia406a066455bd83c2199f96507a11b36aa80fea2 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/46662 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexandre Ioffe Reviewed-by: John L. Hammond Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger --- lustre/tests/hot-pools.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/tests/hot-pools.sh b/lustre/tests/hot-pools.sh index 6af2243..cf9a754 100755 --- a/lustre/tests/hot-pools.sh +++ b/lustre/tests/hot-pools.sh @@ -185,10 +185,12 @@ init_hot_pools_env() { init_lpurge_vars # disable filesystem-wide default LMV to mkdir on MDT0 by default - local dmv=$(getfattr -d -m trusted.dmv -e hex --absolute-names $MOUNT) - - (( $? == 0 )) && $LFS setdirstripe -D -i 0 --max-inherit 1 $MOUNT && - stack_trap "echo $dmv | setfattr --restore=-" + local tmp=$(mktemp $TMP/setfattr.XXXXXXXXXX) + getfattr -d -m trusted.dmv -e hex --absolute-names $MOUNT > $tmp + if (( $? == 0 )); then + ! $LFS setdirstripe -D -i 0 --max-inherit 1 $MOUNT || + stack_trap "setfattr --restore $tmp; rm -f $tmp" + fi } hot_pools_logfile() { -- 1.8.3.1