From: Luis Chamberlain <mcgrof@kernel.org>
To: osandov@fb.com, bvanassche@acm.org, mcgrof@kernel.org
Cc: kch@nvidia.com, linux-block@vger.kernel.org
Subject: [PATCH v3 2/2] tests/srp/rc: replace module removal with patient module removal
Date: Tue, 20 Dec 2022 15:53:24 -0800 [thread overview]
Message-ID: <20221220235324.1445248-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20221220235324.1445248-1-mcgrof@kernel.org>
Bart had put the remove_mpath_devs() call inside a loop because multipathd
keeps running while the loop is ongoing and hence can modify paths
while the loop is running. The races that multipathd can trigger with the
module refcnt is precisely the sort of races which patient module
removal is supposed to address.
I've tested blktests with this on kdevops without finding any
regressions in testing. srp tests were run with and without
use_siw=1.
Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
tests/srp/rc | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/tests/srp/rc b/tests/srp/rc
index 4d504f7bd0cc..a5c0444a958e 100755
--- a/tests/srp/rc
+++ b/tests/srp/rc
@@ -320,19 +320,10 @@ start_srp_ini() {
# Unload the SRP initiator driver.
stop_srp_ini() {
- local i
-
log_out
- for ((i=40;i>=0;i--)); do
- remove_mpath_devs || return $?
- _unload_module ib_srp >/dev/null 2>&1 && break
- sleep 1
- done
- if [ -e /sys/module/ib_srp ]; then
- echo "Error: unloading kernel module ib_srp failed"
- return 1
- fi
- _unload_module scsi_transport_srp || return $?
+ remove_mpath_devs || return $?
+ _patient_rmmod ib_srp || return 1
+ _patient_rmmod scsi_transport_srp || return $?
}
# Associate the LIO device with name $1/$2 with file $3 and SCSI serial $4.
--
2.35.1
prev parent reply other threads:[~2022-12-20 23:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 23:53 [PATCH v3 0/2] blktests: use patient module remover Luis Chamberlain
2022-12-20 23:53 ` [PATCH v3 1/2] blktests: replace module removal with patient module removal Luis Chamberlain
2022-12-21 0:32 ` Luis Chamberlain
2022-12-27 11:40 ` Shinichiro Kawasaki
2022-12-20 23:53 ` Luis Chamberlain [this message]
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=20221220235324.1445248-3-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=bvanassche@acm.org \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@fb.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.