[PATCH] xfstests: test for scsi_debug before trying to rmmod it

Eric Sandeen sandeen at redhat.com
Thu Mar 8 17:51:55 CST 2012


_cleanup does _put_scsi_debug_dev but there's a chance
the module has already been removed in the non-error
case.

If it's not loaded, don't try to rmmod it.

Signed-off-by: Eric Sandeen <sandeen at redhat.com>
---

diff --git a/common.scsi_debug b/common.scsi_debug
index 9f9177c..08efa58 100644
--- a/common.scsi_debug
+++ b/common.scsi_debug
@@ -58,5 +58,6 @@ _get_scsi_debug_dev()
 _put_scsi_debug_dev()
 {
 	sleep 1
+	grep -q scsi_debug /proc/modules || return
 	rmmod scsi_debug || _fail "Could not remove scsi_debug module"
 }



More information about the xfs mailing list