All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Cc: Dave Chinner <dchinner@redhat.com>
Subject: [PATCH] xfstests: test for scsi_debug before trying to rmmod it
Date: Thu, 08 Mar 2012 17:51:55 -0600	[thread overview]
Message-ID: <4F59461B.7040608@redhat.com> (raw)

_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@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"
 }

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2012-03-09  0:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 23:51 Eric Sandeen [this message]
2012-03-09  0:05 ` [PATCH V2] xfstests: clean up scsi_debug module handling Eric Sandeen
2012-03-09 17:27   ` Ben Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F59461B.7040608@redhat.com \
    --to=sandeen@redhat.com \
    --cc=dchinner@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.