From 5bbff445922933957b28cf2abd8c4d9e7088abc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Thu, 21 Apr 2022 13:29:12 +0200 Subject: [PATCH] scripts: zfs.sh: explicitly ignore unloaded modules when unloading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Atkinson Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13356 --- scripts/zfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zfs.sh b/scripts/zfs.sh index 9ead0316d9ee..16c7f8b8df4b 100755 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -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"