[PATCH] common/config: use modprobe -w when supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We had added support for open coding a patient module remover long
ago on fstests through commit d405c21d40aa1 ("common/module: add patient
module rmmod support") to fix many flaky tests. This assumed we'd end up
with modprobe -p -t <msec-timeout> but in the end kmod upstream just
used modprobe -w <msec-timeout> through the respective kmod commit
2b98ed888614 ("modprobe: Add --wait").

Take advantage of the upstream patient module remover support added
since June 2022, so many distributions should already have support for
this now.

Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---

Eric, I saw you mentioning on IRC you didn't understand *why*
the patient module remover was added. Even though I thought the
commit log explained it, let me summarize again: fix tons of
flaky tests which assume module removal is being done correctly.
It is not and fixing this is a module specific issue like with
scsi_debug as documented in the commit log bugzilla references.
So any sane test suite thing relying on module removal should use
something like modprobe -w <timeout-in-ms>.

  Luis

 common/config | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/config b/common/config
index fcff0660b05a..d899129fd5f1 100644
--- a/common/config
+++ b/common/config
@@ -264,7 +264,7 @@ export UDEV_SETTLE_PROG
 # Set MODPROBE_PATIENT_RM_TIMEOUT_SECONDS to "forever" if you want the patient
 # modprobe removal to run forever trying to remove a module.
 MODPROBE_REMOVE_PATIENT=""
-modprobe --help >& /dev/null && modprobe --help 2>&1 | grep -q -1 "remove-patiently"
+modprobe --help >& /dev/null && modprobe --help 2>&1 | grep -q -1 "wait TIMEOUT_MSEC"
 if [[ $? -ne 0 ]]; then
 	if [[ -z "$MODPROBE_PATIENT_RM_TIMEOUT_SECONDS" ]]; then
 		# We will open code our own implementation of patient module
@@ -276,19 +276,19 @@ else
 	if [[ ! -z "$MODPROBE_PATIENT_RM_TIMEOUT_SECONDS" ]]; then
 		if [[ "$MODPROBE_PATIENT_RM_TIMEOUT_SECONDS" != "forever" ]]; then
 			MODPROBE_PATIENT_RM_TIMEOUT_MS="$((MODPROBE_PATIENT_RM_TIMEOUT_SECONDS * 1000))"
-			MODPROBE_RM_PATIENT_TIMEOUT_ARGS="-t $MODPROBE_PATIENT_RM_TIMEOUT_MS"
+			MODPROBE_RM_PATIENT_TIMEOUT_ARGS="-w $MODPROBE_PATIENT_RM_TIMEOUT_MS"
 		fi
 	else
 		# We export MODPROBE_PATIENT_RM_TIMEOUT_SECONDS here for parity
-		# with environments without support for modprobe -p, but we
+		# with environments without support for modprobe -w, but we
 		# only really need it exported right now for environments which
-		# don't have support for modprobe -p to implement our own
+		# don't have support for modprobe -w to implement our own
 		# patient module removal support within fstests.
 		export MODPROBE_PATIENT_RM_TIMEOUT_SECONDS="50"
 		MODPROBE_PATIENT_RM_TIMEOUT_MS="$((MODPROBE_PATIENT_RM_TIMEOUT_SECONDS * 1000))"
-		MODPROBE_RM_PATIENT_TIMEOUT_ARGS="-t $MODPROBE_PATIENT_RM_TIMEOUT_MS"
+		MODPROBE_RM_PATIENT_TIMEOUT_ARGS="-w $MODPROBE_PATIENT_RM_TIMEOUT_MS"
 	fi
-	MODPROBE_REMOVE_PATIENT="modprobe -p $MODPROBE_RM_PATIENT_TIMEOUT_ARGS"
+	MODPROBE_REMOVE_PATIENT="modprobe $MODPROBE_RM_PATIENT_TIMEOUT_ARGS"
 fi
 export MODPROBE_REMOVE_PATIENT
 
-- 
2.45.2





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux