Whamcloud - gitweb
LU-7736 scripts: ensure lustre_rmmod unload all modules 79/18279/2
authorGregoire Pichon <gregoire.pichon@bull.net>
Wed, 3 Feb 2016 15:07:38 +0000 (16:07 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 14 Mar 2016 02:41:46 +0000 (02:41 +0000)
The luste_rmmod script unloads the lustre modules recursively from
libcfs, unloading each dependent module first.

If the module dependency order makes an LND module to be unloaded
before the ptlrpc module, the LND unload fails and it results in
lnet and libcfs modules still loaded at the end.

# modprobe lustre
# lctl list_nids
10.1.0.64@o2ib
# lustre_rmmod
Modules still loaded:
lnet/lnet/lnet.o libcfs/libcfs/libcfs.o

This patch ensures modules are all unloaded by the lustre_rmmod
script.

Signed-off-by: Gregoire Pichon <gregoire.pichon@bull.net>
Change-Id: Id94308332a4f5f95f4617f0d5882a9e2857ee20d
Reviewed-on: http://review.whamcloud.com/18279
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Frederic Saunier <frederic.saunier@atos.net>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/scripts/lustre_rmmod

index a4f81d8..8c07f78 100755 (executable)
@@ -30,6 +30,7 @@ unload_dep_module() {
 
 lsmod | grep obdclass > /dev/null && $LCTL dl
 lsmod | grep $FSTYPE > /dev/null && unload_dep_module $FSTYPE
+lsmod | grep ptlrpc > /dev/null && unload_dep_module ptlrpc
 lsmod | grep libcfs > /dev/null && unload_dep_module libcfs
 
 MODULES=$($LCTL modules | awk '{ print $2 }')