From 9312e0fd1e162094ba2470408878879fa24eeaf7 Mon Sep 17 00:00:00 2001 From: "Adam D. Moss" Date: Sat, 20 Feb 2021 20:23:10 -0800 Subject: Fix error message when zfs module are already unloaded Using zfs-sh -u on linux will fail with inaccurate message when the zfs modules are already unloaded. Deal with the case where a module is already unloaded; its USE_COUNT will be the empty string Reviewed-by: Brian Behlendorf Signed-off-by: Adam Moss Closes #11627 --- scripts/zfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zfs.sh b/scripts/zfs.sh index c131429c9..2f5f3f8fd 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -198,7 +198,7 @@ unload_modules_linux() { if [ "$USE_COUNT" = "0" ] ; then unload_module_linux "$KMOD" || return 1 - else + elif [ "$USE_COUNT" != "" ] ; then echo "Module ${NAME} is still in use!" return 1 fi -- cgit v1.2.3