scripts: zfs.sh: explicitly unload all modules via rmmod
modprobe -r only works for depmodded modules, but this also means we have to re-iterate legacy modules, and in the right order 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:
parent
bee24d6929
commit
c8871ff784
@ -18,7 +18,7 @@ STACK_TRACER="no"
|
|||||||
|
|
||||||
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
|
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
|
||||||
LDMOD=${LDMOD:-/sbin/modprobe}
|
LDMOD=${LDMOD:-/sbin/modprobe}
|
||||||
DELMOD=${DELMOD:-/sbin/modprobe -r}
|
DELMOD=${DELMOD:-/sbin/rmmod}
|
||||||
|
|
||||||
KMOD_ZLIB_DEFLATE=${KMOD_ZLIB_DEFLATE:-zlib_deflate}
|
KMOD_ZLIB_DEFLATE=${KMOD_ZLIB_DEFLATE:-zlib_deflate}
|
||||||
KMOD_ZLIB_INFLATE=${KMOD_ZLIB_INFLATE:-zlib_inflate}
|
KMOD_ZLIB_INFLATE=${KMOD_ZLIB_INFLATE:-zlib_inflate}
|
||||||
@ -162,9 +162,12 @@ unload_modules_freebsd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unload_modules_linux() {
|
unload_modules_linux() {
|
||||||
NAME="${KMOD_ZFS##*/}"
|
legacy_kmods="icp zzstd zlua zcommon zunicode znvpair zavl"
|
||||||
NAME="${NAME%.ko}"
|
for KMOD in "$KMOD_ZFS" $legacy_kmods "$KMOD_SPL"; do
|
||||||
! [ -d "/sys/module/$NAME" ] || $DELMOD "$NAME" || return
|
NAME="${KMOD##*/}"
|
||||||
|
NAME="${NAME%.ko}"
|
||||||
|
! [ -d "/sys/module/$NAME" ] || $DELMOD "$NAME" || return
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$VERBOSE" = "yes" ]; then
|
if [ "$VERBOSE" = "yes" ]; then
|
||||||
echo "Successfully unloaded ZFS module stack"
|
echo "Successfully unloaded ZFS module stack"
|
||||||
|
Loading…
Reference in New Issue
Block a user