Skip to content

Commit

Permalink
Fix error message when zfs module are already unloaded
Browse files Browse the repository at this point in the history
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 openzfs#11627
  • Loading branch information
adamdmoss authored and jsai20 committed Mar 30, 2021
1 parent 3e22a24 commit 2b46965
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b46965

Please sign in to comment.