Whamcloud - gitweb
LU-2625 scripts: prevent several errors in lustre_rmmod
authorGregoire Pichon <gregoire.pichon@bull.net>
Wed, 16 Jan 2013 13:59:53 +0000 (14:59 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 14 Feb 2013 15:36:50 +0000 (10:36 -0500)
This fix prevents lustre_rmmod scripts from returning
errors when lustre modules are partially or not loaded.

Signed-off-by: Gregoire Pichon <gregoire.pichon@bull.net>
Change-Id: Iefb4166b9b14315319858031f53ecb148c589474
Reviewed-on: http://review.whamcloud.com/5040
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/scripts/lustre_rmmod

index e07f4c9..a4f81d8 100755 (executable)
@@ -28,9 +28,9 @@ unload_dep_module() {
     return 0
 }
 
-lsmod | grep libcfs > /dev/null && $LCTL dl
-lsmod | grep $FSTYPE && unload_dep_module $FSTYPE
-unload_dep_module libcfs
+lsmod | grep obdclass > /dev/null && $LCTL dl
+lsmod | grep $FSTYPE > /dev/null && unload_dep_module $FSTYPE
+lsmod | grep libcfs > /dev/null && unload_dep_module libcfs
 
 MODULES=$($LCTL modules | awk '{ print $2 }')
 if [ -n "$MODULES" ]; then