scripts: zfs.sh: explicitly ignore unloaded modules when unloading

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13356
This commit is contained in:
наб 2022-04-21 13:29:12 +02:00 committed by Brian Behlendorf
parent 2f31b585e7
commit bee24d6929

View File

@ -164,7 +164,7 @@ unload_modules_freebsd() {
unload_modules_linux() {
NAME="${KMOD_ZFS##*/}"
NAME="${NAME%.ko}"
$DELMOD "$NAME" || return
! [ -d "/sys/module/$NAME" ] || $DELMOD "$NAME" || return
if [ "$VERBOSE" = "yes" ]; then
echo "Successfully unloaded ZFS module stack"