fix w-racer.sh umounting wrapfs stacked on itself
authoraburford <andrew.burford@stonybrook.edu>
Sat, 14 May 2022 16:37:08 +0000 (12:37 -0400)
committeraburford <andrew.burford@stonybrook.edu>
Sat, 14 May 2022 16:37:08 +0000 (12:37 -0400)
tests/w-racer.sh

index ef638122c5ba07bee535561233d397e745966377..987686f44d362ec067a0d5a4113ba3e11b53bc37 100755 (executable)
@@ -36,7 +36,6 @@ case "$type" in
     wrapfs )
        runcmd lsof $TMP_DIR
        runcmd umount $TMP_DIR
-       runcmd rmmod wrapfs
        ;;
     bind )
        runcmd umount $TMP_DIR
@@ -60,14 +59,17 @@ case "$lowertype" in
        runcmd umount $LOWER_DIR
        ;;
     wrapfs )
-       runcmd lsof $LOWER_DIR
-       runcmd umount $LOWER_DIR
        runcmd lsof $SCRATCH_DIR
        runcmd umount $SCRATCH_DIR
+       runcmd lsof $LOWER_DIR
+       runcmd umount $LOWER_DIR
 esac
+if test $type == "wrapfs"; then
+       runcmd rmmod wrapfs
+fi
 }
 
-dirs="$TMP_DIR $LOWER_DIR $SCRATCH_DIR"
+dirs="$TMP_DIR $SCRATCH_DIR $LOWER_DIR"
 for d in $dirs; do
        if cat /proc/mounts | grep $d; then
                runcmd umount $d