From: Arshad Hussain Date: Mon, 7 Oct 2024 11:48:28 +0000 (-0400) Subject: LU-18337 tests: Fix racer division by 0 error message X-Git-Tag: 2.16.51~63 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f824ccc8f1db3246dd1d64ba9ae4e52e765f0fa8;p=fs%2Flustre-release.git LU-18337 tests: Fix racer division by 0 error message 'file' under file_create.sh is set as /mnt/lustre/racer/M/N Currently M/N is used directly as mathematical operation to determine whether "--block" (default) is to be passed as option to 'migrate'. This was causing the divide by zero error when N is 0. This patch changes 'file' to use only the last part (ie N) instead of M/N when doing the mod by 8 operation. Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: I590250afb69607d906cf3f8422ca4bc97600eabb Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56598 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Deiter Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/racer/file_create.sh b/lustre/tests/racer/file_create.sh index 9a8d857..cf89ee9 100755 --- a/lustre/tests/racer/file_create.sh +++ b/lustre/tests/racer/file_create.sh @@ -57,7 +57,7 @@ while /bin/true; do opt=${opt/create/extend} else opt=${opt/setstripe/migrate} - (( file % 8 == 0 )) && opt+=" --block" + (( ${file/*\//} % 8 == 0 )) && opt+=" --block" fi fi $LFS $opt $DIR/$file 2> /dev/null || true