Don't assume there are multiple MDTs for the target directory
when running dir_migrate and dir_remote. If only one MDT
(or none, if running on a non-Lustre directory for some reason),
just exit from these workloads instead of spewing errors.
Test-parameters: trivial testlist=sanityn
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I47cbe9de2c4f9afd79228b6a505dde023f2540e5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51267
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alex Deiter <alex.deiter@gmail.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
MAX=$2
MDTCOUNT=${MDSCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c MDT)}
-while /bin/true ; do
+while (( MDTCOUNT > 1 )) ; do
migrate_dir=$((RANDOM % MAX))
file=$((RANDOM % MAX))
mdt_idx=$((RANDOM % MDTCOUNT))
MAX=$2
MDTCOUNT=${MDSCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c MDT)}
-while /bin/true ; do
+while (( MDTCOUNT > 1 )) ; do
remote_dir=$((RANDOM % MAX))
file=$((RANDOM % MAX))
mdt_idx=$((RANDOM % MDTCOUNT))