aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-04-21 13:29:12 +0200
committerBrian Behlendorf <[email protected]>2022-04-21 16:32:28 -0700
commitbee24d69295b9d31eed85f5eac7f313250aebf56 (patch)
tree14702757098dc9f32dfe99f290d215e404248ea2
parent2f31b585e77780b887c3cbf01c0b5498c42fe302 (diff)
scripts: zfs.sh: explicitly ignore unloaded modules when unloading
Reviewed-by: Brian Atkinson <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13356
-rwxr-xr-xscripts/zfs.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh
index 9ead0316d..16c7f8b8d 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"