Whamcloud - gitweb
LU-18337 tests: Fix racer division by 0 error message 98/56598/5
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Mon, 7 Oct 2024 11:48:28 +0000 (07:48 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2024 08:14:27 +0000 (08:14 +0000)
'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 <arshad.hussain@aeoncomputing.com>
Change-Id: I590250afb69607d906cf3f8422ca4bc97600eabb
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56598
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Deiter <adeiter@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/racer/file_create.sh

index 9a8d857..cf89ee9 100755 (executable)
@@ -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