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 <behlendorf1@llnl.gov>
Signed-off-by: Adam Moss <c@yotes.com>
Closes #11627
This commit is contained in:
Adam D. Moss 2021-02-20 20:23:10 -08:00 committed by GitHub
parent 11f2e9a491
commit 9312e0fd1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ unload_modules_linux() {
if [ "$USE_COUNT" = "0" ] ; then if [ "$USE_COUNT" = "0" ] ; then
unload_module_linux "$KMOD" || return 1 unload_module_linux "$KMOD" || return 1
else elif [ "$USE_COUNT" != "" ] ; then
echo "Module ${NAME} is still in use!" echo "Module ${NAME} is still in use!"
return 1 return 1
fi fi