From ef708dee307230c2c1fbd4872d625c09e838338b Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Tue, 18 Jun 2019 00:19:02 +0530 Subject: [PATCH] LU-12446 tests: Fix use of undefined variable under sanityn.sh/16b Under sanityn.sh/16b variable STRIPE_BYTES is used to define the block size within 'dd' command. However STRIPE_BYTES is used undefined. This results in 'dd' command failing silently. Although this does not affect the outcome of the test, the 'dd' command used this way is no-op. This patch fixes use of undefined variable under sanityn.sh:16b by replacing variable STRIPE_BYTES with variable stripe_size. Test-Parameters: trivial testlist=sanityn Change-Id: I8bc947d93e339573759d5d37e800aae9bc3b4b18 Signed-off-by: Arshad Hussain Reviewed-on: https://review.whamcloud.com/35246 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez --- lustre/tests/sanityn.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 38b884a1..b2f41a7 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -417,18 +417,21 @@ run_test 16a "$FSXNUM iterations of dual-mount fsx" test_16b() { local file1=$DIR1/$tfile local file2=$DIR2/$tfile + local stripe_size=($($LFS getstripe -S $DIR)) # to allocate grant because it may run out due to test_15. lfs setstripe -c -1 $file1 - dd if=/dev/zero of=$file1 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync - dd if=/dev/zero of=$file2 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync + dd if=/dev/zero of=$file1 bs=$stripe_size count=$OSTCOUNT oflag=sync || + error "dd failed writing to file=$file1" + dd if=/dev/zero of=$file2 bs=$stripe_size count=$OSTCOUNT oflag=sync || + error "dd failed writing to file=$file2" rm -f $file1 lfs setstripe -c -1 $file1 # b=10919 # -o is set to 8192 because writes < 1 page and between 1 and 2 pages # create a mix of tiny writes & normal writes fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -o 8192 -S 0 $file1 \ - $file2 + $file2 || error "fsx with tiny write failed." } run_test 16b "$FSXNUM iterations of dual-mount fsx at small size" -- 1.8.3.1