lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210921174952.1286037-1-mcgrof@kernel.org>
Date:   Tue, 21 Sep 2021 10:49:52 -0700
From:   Luis Chamberlain <mcgrof@...nel.org>
To:     fstests@...r.kernel.org
Cc:     hare@...e.de, dgilbert@...erlog.com, jeyu@...nel.org,
        lucas.demarchi@...el.com, linux-kernel@...r.kernel.org,
        Luis Chamberlain <mcgrof@...nel.org>, Eryu Guan <guan@...u.me>
Subject: [PATCH] common/module: use patient module removal

Now that scsi_debug has been using the patient module removal
for a while, let's generalize its use for the other use cases.
This likey will fix some odd false positives due to races.

Suggested-by: Eryu Guan <guan@...u.me>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
 common/module | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/module b/common/module
index 0392f20c..ead0f881 100644
--- a/common/module
+++ b/common/module
@@ -16,7 +16,7 @@ _reload_module()
 {
 	local module="$1"
 
-	modprobe -r "${module}" || _fail "${module} unload failed"
+	_patient_rmmod "${module}" || _fail "${module} unload failed"
 	modprobe "${module}" || _fail "${module} load failed"
 }
 
@@ -44,7 +44,7 @@ _require_loadable_module()
 	local module="$1"
 
 	modinfo "${module}" > /dev/null 2>&1 || _notrun "${module}: must be a module."
-	modprobe -r "${module}" || _notrun "Require ${module} to be unloadable"
+	_patient_rmmod "${module}" || _notrun "Require ${module} to be unloadable"
 	modprobe "${module}" || _notrun "${module} load failed"
 }
 
@@ -64,7 +64,7 @@ _require_loadable_fs_module()
 	test -n "${had_scratchfs}" && _scratch_unmount
 	local unload_ok=""
 	local load_ok=""
-	modprobe -r "${module}" || unload_ok=0
+	_patient_rmmod "${module}" || unload_ok=0
 	modprobe "${module}" || load_ok=0
 	test -n "${had_scratchfs}" && _scratch_mount 2> /dev/null
 	test -n "${had_testfs}" && _test_mount 2> /dev/null
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ