X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fzpios.sh;h=0fcb88d4bf4f7bd8a1779226783ceb937fc94a1f;hb=7634cd54db25a69e00aaab6448ad710441bd8e7d;hp=e16a58a3ba6cd927b9347c0f3176c7e7c30c3464;hpb=302ef1517e5769cbe6a12d94c89f44a90721bfd4;p=zfs.git diff --git a/scripts/zpios.sh b/scripts/zpios.sh index e16a58a..0fcb88d 100755 --- a/scripts/zpios.sh +++ b/scripts/zpios.sh @@ -42,6 +42,15 @@ OPTIONS: EOF } +unload_die() { + unload_modules + while [ -c /dev/zpios ]; do + sleep 1 + done + + exit 1 +} + print_header() { echo --------------------- ZPIOS RESULTS ---------------------------- echo -n "Date: "; date @@ -220,7 +229,7 @@ fi check_test || die "${ERROR}" . ${ZPIOS_TEST} -# Pull in the zpios test module is not loaded. If this fails it is +# Pull in the zpios test module if not loaded. If this fails, it is # likely because the full module stack was not yet loaded with zfs.sh if check_modules; then if ! load_modules; then @@ -242,7 +251,7 @@ fi # Create the zpool configuration ${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} ${FORCE_FLAG} \ -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} \ - -l "${ZPOOL_OPTIONS}" -s "${ZFS_OPTIONS}" || exit 1 + -l "${ZPOOL_OPTIONS}" -s "${ZFS_OPTIONS}" || unload_die if [ ${PROFILE} ]; then zpios_profile_start @@ -261,7 +270,7 @@ fi # Destroy the zpool configuration ${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} ${FORCE_FLAG} \ - -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} -d || exit 1 + -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} -d || unload_die # Unload the test module stack and wait for device removal unload_modules