Whamcloud - gitweb
LU-13667 ptlrpc: fix endless loop issue
[fs/lustre-release.git] / lustre / tests / racer / racer.sh
index 1da6465..45c66ee 100755 (executable)
@@ -1,9 +1,8 @@
 #!/bin/bash
 #set -x
 
+DIR="$1"
 MAX_FILES=${MAX_FILES:-20}
-DIR=${DIR:-$1}
-DIR=${DIR:-"/mnt/lustre/racer"}
 DURATION=${DURATION:-$((60*5))}
 MDSCOUNT=${MDSCOUNT:-1}
 
@@ -13,10 +12,15 @@ NUM_THREADS=${NUM_THREADS:-3}
 mkdir -p $DIR
 
 RACER_PROGS="file_create dir_create file_rm file_rename file_link file_symlink \
-file_list file_concat file_exec"
+file_list file_concat file_exec file_chown file_chmod file_mknod file_truncate \
+file_delxattr file_getxattr file_setxattr"
 
-if [ $MDSCOUNT -gt 1 ]; then
-       RACER_PROGS="${RACER_PROGS} dir_remote dir_migrate"
+if $RACER_ENABLE_REMOTE_DIRS || $RACER_ENABLE_STRIPED_DIRS; then
+       RACER_PROGS+=' dir_remote'
+fi
+
+if $RACER_ENABLE_MIGRATION; then
+       RACER_PROGS+=' dir_migrate'
 fi
 
 racer_cleanup()
@@ -41,6 +45,14 @@ racer_cleanup()
                        killall -0 $P.sh
                        [[ $? -eq 0 ]] && (( rc+=1 ))
                done
+
+               # Kill dd processes to speedup cleanup
+               local pids=$(ps uax | grep "$DIR" | grep dd | grep -v grep |
+                               awk '{print $2}')
+               for pid in $pids; do
+                       kill $pid
+               done
+
                if [[ $rc -eq 0 ]]; then
                        echo there should be NO racer processes:
                        ps uww -C "${RACER_PROGS// /,}"