[PATCH blktests 5/5] Revert "nbd/rc: load nbd module explicitly"

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

 



This reverts commit 78271b8bb8c939e1d0b9cfa3ea321a4ed06635bd.

Once I thought explicit nbd module load in nbd/rc is required due to the
commit 06a0ba866d90 ("common/rc: avoid module load in _have_driver()").
However, it was not a good solution and _have_driver() was modified
again to load module. Hence, revert explicit nbd module load in nbd/rc.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
---
 tests/nbd/rc | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/tests/nbd/rc b/tests/nbd/rc
index 32eea45..9c1c15b 100644
--- a/tests/nbd/rc
+++ b/tests/nbd/rc
@@ -28,21 +28,17 @@ _have_nbd() {
 }
 
 _have_nbd_netlink() {
-	local ret=0
-
 	if ! _have_nbd; then
 		return 1
 	fi
 	if ! _have_program genl-ctrl-list; then
 		return 1
 	fi
-	modprobe -q nbd
 	if ! genl-ctrl-list | grep -q nbd; then
 		SKIP_REASONS+=("nbd does not support netlink")
-		ret=1
+		return 1
 	fi
-	modprobe -qr nbd
-	return $ret
+	return 0
 }
 
 _wait_for_nbd_connect() {
@@ -66,7 +62,6 @@ _wait_for_nbd_disconnect() {
 }
 
 _start_nbd_server() {
-	modprobe -q nbd
 	truncate -s 10G "${TMPDIR}/export"
 	cat > "${TMPDIR}/nbd.conf" << EOF
 [generic]
@@ -78,20 +73,17 @@ EOF
 
 _stop_nbd_server() {
 	kill -SIGTERM "$(cat "${TMPDIR}/nbd.pid")"
-	modprobe -qr nbd
 	rm -f "${TMPDIR}/nbd.pid"
 	rm -f "${TMPDIR}/export"
 }
 
 _start_nbd_server_netlink() {
-	modprobe -q nbd
 	truncate -s 10G "${TMPDIR}/export"
 	nbd-server 8000 "${TMPDIR}/export" >/dev/null 2>&1
 }
 
 _stop_nbd_server_netlink() {
 	killall -SIGTERM nbd-server
-	modprobe -qr nbd
 	rm -f "${TMPDIR}/export"
 }
 
-- 
2.37.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux