From: Luis Chamberlain <mcgrof@kernel.org>
To: shinichiro.kawasaki@wdc.com
Cc: linux-block@vger.kernel.org, patches@lists.linux.dev,
gost.dev@samsung.com, sw.prabhu6@gmail.com,
kernel@pankajraghav.com, bvanassche@acm.org, mcgrof@kernel.org
Subject: [PATCH v4 2/2] tests/srp/rc: replace module removal with patient module removal
Date: Wed, 26 Nov 2025 09:11:02 -0800 [thread overview]
Message-ID: <20251126171102.3663957-3-mcgrof@kernel.org> (raw)
In-Reply-To: <20251126171102.3663957-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.
Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Rebased-by: Claude AI
---
tests/srp/rc | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/tests/srp/rc b/tests/srp/rc
index 8585272..2d3d615 100755
--- a/tests/srp/rc
+++ b/tests/srp/rc
@@ -331,19 +331,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.51.0
prev parent reply other threads:[~2025-11-26 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 17:11 [PATCH v4 0/2] blktests: use patient module remover Luis Chamberlain
2025-11-26 17:11 ` [PATCH v4 1/2] blktests: replace module removal with patient module removal Luis Chamberlain
2025-11-26 17:44 ` Bart Van Assche
2025-12-19 5:29 ` Shinichiro Kawasaki
2025-12-22 18:11 ` Swarna Prabhu
2025-12-25 12:00 ` Shinichiro Kawasaki
2025-12-18 10:44 ` Shinichiro Kawasaki
2025-12-19 3:06 ` Luis Chamberlain
2025-12-25 12:05 ` Shinichiro Kawasaki
2025-11-26 17:11 ` 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=20251126171102.3663957-3-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=bvanassche@acm.org \
--cc=gost.dev@samsung.com \
--cc=kernel@pankajraghav.com \
--cc=linux-block@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=shinichiro.kawasaki@wdc.com \
--cc=sw.prabhu6@gmail.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.