aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam D. Moss <[email protected]>2021-02-20 20:23:10 -0800
committerGitHub <[email protected]>2021-02-20 20:23:10 -0800
commit9312e0fd1e162094ba2470408878879fa24eeaf7 (patch)
treee0d63d9f53263e31ff922567fb36309e15de65a0
parent11f2e9a491baa2ae3fc00f6b8b892fa91a852ca1 (diff)
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 <[email protected]> Signed-off-by: Adam Moss <[email protected]> Closes #11627
-rwxr-xr-xscripts/zfs.sh2
1 files changed, 1 insertions, 1 deletions
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