From patchwork Mon May 30 13:08:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F3DCC433FE for ; Mon, 30 May 2022 13:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235014AbiE3NIU (ORCPT ); Mon, 30 May 2022 09:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236311AbiE3NIT (ORCPT ); Mon, 30 May 2022 09:08:19 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E09870904 for ; Mon, 30 May 2022 06:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=1iTf7Qet2TO/OJElGF0bDUHAoibVwZrzdRnAkEJ0pks=; b=XqU8DL3XtX2LaIq2+A0Mxu3t25 3WWWJW144/N3K7LfFYdVx+5zlOr9LU4LKYoyIQNVWd9MegYOc6atDrJsg+T0nrq9IcNaWQ2cIcK+b 5jqGCTFdobfSuQKy6BCj0b/8PKyimQIFj4dRFSNazHcEVXPSdPt26Q43MU6mFnlCWXsgJpeZPOX67 MhzTruHsfGsgvDeDnwJvuGOM9lgrZ7d4dgBHIBkUaYE9xTTR5cKSZ7LcIMS5L01fXVZ41R2ptTtGB 0UUVqQndZNm9wX7q922MtTfgJ+TAjz6uUyefAwRCmFd/AOc4MK336IdaQDJixszwQHBixQW0QFa6n in+vHmjA==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf85-006bl1-Ds; Mon, 30 May 2022 13:08:17 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 1/9] nvme: use _have_loop instead of _have_modules loop Date: Mon, 30 May 2022 15:08:03 +0200 Message-Id: <20220530130811.3006554-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Also check for the losetup existance. Signed-off-by: Christoph Hellwig Reviewed-by: Shin'ichiro Kawasaki --- tests/nvme/002 | 2 +- tests/nvme/003 | 2 +- tests/nvme/004 | 2 +- tests/nvme/005 | 3 +-- tests/nvme/006 | 2 +- tests/nvme/008 | 2 +- tests/nvme/010 | 2 +- tests/nvme/012 | 2 +- tests/nvme/014 | 2 +- tests/nvme/015 | 2 +- tests/nvme/018 | 2 +- tests/nvme/019 | 2 +- tests/nvme/021 | 2 +- tests/nvme/022 | 2 +- tests/nvme/023 | 2 +- tests/nvme/024 | 2 +- tests/nvme/025 | 2 +- tests/nvme/026 | 2 +- tests/nvme/027 | 2 +- tests/nvme/028 | 2 +- tests/nvme/029 | 2 +- tests/nvme/030 | 2 +- tests/nvme/031 | 2 +- 23 files changed, 23 insertions(+), 24 deletions(-) diff --git a/tests/nvme/002 b/tests/nvme/002 index ca11c11..6c6ae5f 100755 --- a/tests/nvme/002 +++ b/tests/nvme/002 @@ -11,7 +11,7 @@ DESCRIPTION="create many subsystems and test discovery" requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_loop } diff --git a/tests/nvme/003 b/tests/nvme/003 index 101c184..2ba6954 100755 --- a/tests/nvme/003 +++ b/tests/nvme/003 @@ -12,7 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/004 b/tests/nvme/004 index 4b0b7ae..9dda538 100755 --- a/tests/nvme/004 +++ b/tests/nvme/004 @@ -13,7 +13,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/005 b/tests/nvme/005 index 9f3e388..de567a7 100755 --- a/tests/nvme/005 +++ b/tests/nvme/005 @@ -12,8 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop && \ - _have_module_param_value nvme_core multipath Y + _have_loop && _have_module_param_value nvme_core multipath Y _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/006 b/tests/nvme/006 index 9230dc6..d993861 100755 --- a/tests/nvme/006 +++ b/tests/nvme/006 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/008 b/tests/nvme/008 index 219fe9b..5568fe4 100755 --- a/tests/nvme/008 +++ b/tests/nvme/008 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/010 b/tests/nvme/010 index 08e39d5..b7b1d51 100755 --- a/tests/nvme/010 +++ b/tests/nvme/010 @@ -11,7 +11,7 @@ TIMED=1 requires() { _nvme_requires - _have_fio && _have_modules loop + _have_fio && _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/012 b/tests/nvme/012 index 6bb4972..c9d2438 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -14,7 +14,7 @@ requires() { _nvme_requires _have_xfs _have_fio - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/014 b/tests/nvme/014 index 48f8caa..d13cff7 100755 --- a/tests/nvme/014 +++ b/tests/nvme/014 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/015 b/tests/nvme/015 index e33cfde..bb52ba2 100755 --- a/tests/nvme/015 +++ b/tests/nvme/015 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/018 b/tests/nvme/018 index 7f407da..315e795 100755 --- a/tests/nvme/018 +++ b/tests/nvme/018 @@ -12,7 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/019 b/tests/nvme/019 index 8259e2e..4cb3509 100755 --- a/tests/nvme/019 +++ b/tests/nvme/019 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/021 b/tests/nvme/021 index fb77f9c..6ee0af1 100755 --- a/tests/nvme/021 +++ b/tests/nvme/021 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/022 b/tests/nvme/022 index 62c4690..1d76ffa 100755 --- a/tests/nvme/022 +++ b/tests/nvme/022 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/023 b/tests/nvme/023 index bce21b5..b65be07 100755 --- a/tests/nvme/023 +++ b/tests/nvme/023 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/024 b/tests/nvme/024 index ffec36c..f756797 100755 --- a/tests/nvme/024 +++ b/tests/nvme/024 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/025 b/tests/nvme/025 index 3d3f01b..941bf36 100755 --- a/tests/nvme/025 +++ b/tests/nvme/025 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/026 b/tests/nvme/026 index 2f56077..c3f06c2 100755 --- a/tests/nvme/026 +++ b/tests/nvme/026 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/027 b/tests/nvme/027 index 53f0664..0ad663a 100755 --- a/tests/nvme/027 +++ b/tests/nvme/027 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/028 b/tests/nvme/028 index 3d9084f..7de977a 100755 --- a/tests/nvme/028 +++ b/tests/nvme/028 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/029 b/tests/nvme/029 index 960e5f5..f8b4cbb 100755 --- a/tests/nvme/029 +++ b/tests/nvme/029 @@ -12,7 +12,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/030 b/tests/nvme/030 index c6d485e..20fef69 100755 --- a/tests/nvme/030 +++ b/tests/nvme/030 @@ -11,7 +11,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } diff --git a/tests/nvme/031 b/tests/nvme/031 index 7c18a64..4e17982 100755 --- a/tests/nvme/031 +++ b/tests/nvme/031 @@ -19,7 +19,7 @@ QUICK=1 requires() { _nvme_requires - _have_modules loop + _have_loop _require_nvme_trtype_is_fabrics } From patchwork Mon May 30 13:08:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4CF6C433F5 for ; Mon, 30 May 2022 13:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236322AbiE3NIW (ORCPT ); Mon, 30 May 2022 09:08:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236311AbiE3NIV (ORCPT ); Mon, 30 May 2022 09:08:21 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9BD870904 for ; Mon, 30 May 2022 06:08:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=3t7tAIs+lapqDmjwRgXDVembunHtARLvAPkViFJb43Y=; b=v1LhVBOHUD6pA8B58aAENTBGwD iYEzmQIFG5hpKL8cFDimR7ewK/pvsWLI/RPc7Qouriog4j9XoRyU97N5OV1NZ/Syo92FYf6IS4ZDe QwatiBIg3q/EmYjSvOXmzjRBXWg0KCDrjI92HbPmj74+uMkShHGhKo8U8n4642nYOKtq1/BFvsiIo ZnfiIiBfx/L1p7QeQRphFbw9xje+wiSynevHx6BjPXvmof2DJOeZiV+u5QjOa3Nwz0N7e6C7yJqTg C49ZEzUDOct5lfnKzMzALtfD710KUmOz+t82FWzCoPjPG7dyvmWTXY+3PXte7zcR/73yvNmfst8I8 GpsQag6g==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf88-006bm5-4D; Mon, 30 May 2022 13:08:20 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 2/9] common: add a helper if a driver is available Date: Mon, 30 May 2022 15:08:04 +0200 Message-Id: <20220530130811.3006554-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Unlike _have_modules this allows allows for a built-in driver. Signed-off-by: Christoph Hellwig Reviewed-by: Shin'ichiro Kawasaki --- common/rc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/rc b/common/rc index 5e35e21..a93b227 100644 --- a/common/rc +++ b/common/rc @@ -28,6 +28,18 @@ _have_root() { return 0 } +_have_driver() +{ + local modname="${1/-/_}" + + if [ ! -d "/sys/module/${modname}" ] && ! modprobe -q ${modname}; then + SKIP_REASON="driver ${modname} is not available" + return 1 + fi + + return 0 +} + _have_modules() { local missing=() local module From patchwork Mon May 30 13:08:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12679C433EF for ; Mon, 30 May 2022 13:08:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236311AbiE3NIZ (ORCPT ); Mon, 30 May 2022 09:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236325AbiE3NIY (ORCPT ); Mon, 30 May 2022 09:08:24 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0CE270908 for ; Mon, 30 May 2022 06:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=nxUj3N4YSuHgSZVRYMRdOH9qH55vosyimsHwk1o0a+M=; b=dBo7O+wSaMhK8v3mv5BNdnhpZI NyEDtNN8CPvedN+eo4adI5tAEh66Kw+xlWOdc+Ywz/7+PqswOnNpLUtmasKyG5OkYbKlcAwHNsqqX z/2TgiuXTu41baUu+9j+sOKoIrWFThtmRb4KDHiGl+4Ic7u2ks6Fwh0UYumLq5tPL17UbnBGk9ofY UE4QgeUrwoucHsOcI7r5wuD2XGwpWplR+5iASgzxlnaEe2lOQI7xjqwiIWcJOx3qpQFCybYH9o9aF NJfH2jdfRp0bm5ParOrP0CyLvYdLewG5OJXKABebrfJOgYHNsGG0BpBZE3nPIZD7BHdSpSBuTU5PB KCrIvH3w==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8A-006bnP-U2; Mon, 30 May 2022 13:08:23 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 3/9] common: fix _have_module_param_value to work with built-in drivers Date: Mon, 30 May 2022 15:08:05 +0200 Message-Id: <20220530130811.3006554-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Don't bother to call modprobe directly and just check the /sys/module/ directory. Also switch to using descriptive variable names for the paramters. Signed-off-by: Christoph Hellwig --- common/rc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/common/rc b/common/rc index a93b227..ffd15b6 100644 --- a/common/rc +++ b/common/rc @@ -74,17 +74,22 @@ _have_module_param() { } _have_module_param_value() { + local modname="${1/-/_}" + local param="$2" + local expected_value="$3" local value - modprobe "$1" + if ! have_driver $modname; then + return 1; + fi - if ! _have_module_param "$1" "$2"; then + if ! _have_module_param $modname $param; then return 1 fi - value=$(cat "/sys/module/$1/parameters/$2") - if [[ "${value}" != "$3" ]]; then - SKIP_REASON="$1 module parameter $2 must be set to $3" + value=$(cat "/sys/module/$modname/parameters/$param") + if [[ "${value}" != "$expected_value" ]]; then + SKIP_REASON="$modname module parameter $param must be set to $expected_value" return 1 fi From patchwork Mon May 30 13:08:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CF02C433EF for ; Mon, 30 May 2022 13:08:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236323AbiE3NI2 (ORCPT ); Mon, 30 May 2022 09:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236324AbiE3NI1 (ORCPT ); Mon, 30 May 2022 09:08:27 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61B1D70904 for ; Mon, 30 May 2022 06:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=8XpyH7ypt4V2s//tkU1u1OrnrAFvSPAexvr5mF2MJEg=; b=barTAuyaFAXUo8dRK+2a9nYnBV h9OuyfawaUec90zYWLh0pb9hnV++SeASa5q6FXIpF3yQpSEWjg66oYoIdWRZip2dW++L8CPZA5RS3 jhey0s02O/S46FCwHy/SZZXO3Y5G24oqjC6i+SsOomZLZLhIn3aakYy0ESkmAFI4VPjV9LFGNgDM5 vkyqbKCNycaHine6gH3YWiYrnIomYqI6ikk+T1IzQ8ZDDABci+FDm04I+1X5oKZMu8gjDmwSlqw9h DY11NCFs1DZaKKlJ6mcVfE/PAmGtq3535xkjz2nuLHonMkj1Mf4H2qsQziGyKOBXR2RCx7sLSaRDS Ob3uz4Wg==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8D-006boQ-LO; Mon, 30 May 2022 13:08:26 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 4/9] common: do not require loop support to be modular Date: Mon, 30 May 2022 15:08:06 +0200 Message-Id: <20220530130811.3006554-5-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_loop as nothing requires the loop driver to be modular. Signed-off-by: Christoph Hellwig Reviewed-by: Shin'ichiro Kawasaki --- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/rc b/common/rc index ffd15b6..d71a81e 100644 --- a/common/rc +++ b/common/rc @@ -128,7 +128,7 @@ _have_src_program() { } _have_loop() { - _have_modules loop && _have_program losetup + _have_driver loop && _have_program losetup } _have_blktrace() { From patchwork Mon May 30 13:08:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864624 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20BD5C433FE for ; Mon, 30 May 2022 13:08:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236325AbiE3NIb (ORCPT ); Mon, 30 May 2022 09:08:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236331AbiE3NIa (ORCPT ); Mon, 30 May 2022 09:08:30 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FFBB70929 for ; Mon, 30 May 2022 06:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Zt5SOYIQBaljWSRSx9PdlQ7CPcrIm29jDIYfpK+YDz0=; b=Nn8+DO1HPqBmuztX9Sh/kq6H4w VjI0xNTeqEgsdOYxBzL2D3abhPIUBlJLymwNGeozGNQjPEoxA930tmcTZkwMXkeAnS6upHI7RRSHd BpmBnOiBjJsLLT/+MrbEJBMeq/+uh9DgEFPIj95UfkUyROVc2AqjaPMjY1ecvr/9Y8EasRrySEvJC l95f3yHykHFKSIiLQCSQpBFHQHh/ikIhzXY5UaOQTTWGhf1LVqcuF51X6+7N2QLHKeBCLh3Ckodvw HZjKItUQKDhLZLlwGYULFUbyHIeZwSmsC9ibdtlOwO9aUKEZ0qPMusY+t6Dwc1FDmnLKAGM+GOW8w 94SvY+hA==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8G-006bpM-BK; Mon, 30 May 2022 13:08:28 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 5/9] common: do not require null_blk support to be modular Date: Mon, 30 May 2022 15:08:07 +0200 Message-Id: <20220530130811.3006554-6-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_null_blk for the basic null_blk check, and instead only require an actual module in _init_null_blk when specific module parameters are passed. Signed-off-by: Christoph Hellwig --- common/null_blk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/null_blk b/common/null_blk index 6611db0..ccf3750 100644 --- a/common/null_blk +++ b/common/null_blk @@ -5,7 +5,7 @@ # null_blk helper functions. _have_null_blk() { - _have_modules null_blk + _have_driver null_blk } _remove_null_blk_devices() { @@ -16,15 +16,19 @@ _remove_null_blk_devices() { } _init_null_blk() { - _remove_null_blk_devices + local modparams="$@" - local zoned="" - if (( RUN_FOR_ZONED )); then zoned="zoned=1"; fi + if (( RUN_FOR_ZONED )); then + modparams="${modparams} zoned=1" + fi - if ! modprobe -r null_blk || ! modprobe null_blk "$@" "${zoned}" ; then + if [ -n "${modparams}" ] && ! _have_modules null_blk; then return 1 fi + _remove_null_blk_devices + modprobe -qr null_blk && modprobe -q null_blk ${modparams} + udevadm settle return 0 } @@ -46,5 +50,5 @@ _configure_null_blk() { _exit_null_blk() { _remove_null_blk_devices udevadm settle - modprobe -r null_blk + modprobe -qr null_blk } From patchwork Mon May 30 13:08:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3232FC433F5 for ; Mon, 30 May 2022 13:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236324AbiE3NId (ORCPT ); Mon, 30 May 2022 09:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236327AbiE3NId (ORCPT ); Mon, 30 May 2022 09:08:33 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09DCD70922 for ; Mon, 30 May 2022 06:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=zNWbO9ANZxDSJkR1uaf2cgdY/2+eyYYE/LgvB5iNw5U=; b=octar8nkcs30OalsDI5g8VywJy nE+ZKiEAELmPvZd4yrokDSPqJegvyprC5EfEJx9/Aayx3iz6VTyI+AUnewP/PYs8Csb0DcXNTN9mK joX+Mc4BDcWNwSOScCxBhZzWdDbEj1l8tv6qx409DUxg6mXMaUJxpFwE7NZccOwNm2spKbRYIErbt yc57hSWxNLwABiBTazxKYpJBhxDIiVVRTQLlO5l4HPGgz7ShWiFzeqavyoLoM6LAJh/jKvg2TJwsr V5weiPAiBSYFytAiJGgbJBBUhKt8B5ClR7nxoax9w0qAh93Ho7CIV5yficcyFqMt0dug+wEGwGRRe 5OXG69IA==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8J-006bqW-3Y; Mon, 30 May 2022 13:08:31 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 6/9] nbd: do not require nbd support to be modular Date: Mon, 30 May 2022 15:08:08 +0200 Message-Id: <20220530130811.3006554-7-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_nbd as nothing requires the nbd driver to be modular. Signed-off-by: Christoph Hellwig --- tests/nbd/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nbd/rc b/tests/nbd/rc index 9d0e3d1..118553c 100644 --- a/tests/nbd/rc +++ b/tests/nbd/rc @@ -7,11 +7,11 @@ . common/rc group_requires() { - _have_root && _have_nbd && modprobe nbd + _have_root && _have_nbd } _have_nbd() { - if ! _have_modules nbd; then + if ! _have_driver nbd; then return 1 fi if ! _have_program nbd-server; then From patchwork Mon May 30 13:08:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70B5AC433EF for ; Mon, 30 May 2022 13:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236327AbiE3NIj (ORCPT ); Mon, 30 May 2022 09:08:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236335AbiE3NIi (ORCPT ); Mon, 30 May 2022 09:08:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21E181980 for ; Mon, 30 May 2022 06:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=4aroAkV9hqMPY4J3fHjOJ8aK1ZmGud0BInPy3cIbfy8=; b=mzVfXCFdPMqfOlMPh2DhTmm337 FQ9Vbfvw/J2L0wBLfCXcBZ56p2GNzArxwgKCctBmbv+BFoTfgzs07+GC0WrJh2qMbblpixJLxlytz jc64j/D0bPYr+JFKliTNrsFdFAT6Qf+OyTxS8xeZAAPk4WyKOZ8cByZiGjJ2ebK5UltEykjoCi2UD Kj/Duyk89gwLvvs8ynjE7oVB+lTRM7XJlqiVlYSxta8ycFG6rfK+Lz9S5DzGVMMnTZAIGvFdGBLaE UMWdufopCQDQixtKLDDZsmJy2BGwpZ97B9Y1m3IZ3Caixb/vujdBZB7yMODBm3p3/l/bDnLKOAHZb yJSBGYHg==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8L-006brG-TQ; Mon, 30 May 2022 13:08:34 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 7/9] scsi: don't require sg to be built in Date: Mon, 30 May 2022 15:08:09 +0200 Message-Id: <20220530130811.3006554-8-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_scsi_generic as nothing requires the sg driver to be modular. Signed-off-by: Christoph Hellwig --- tests/scsi/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scsi/rc b/tests/scsi/rc index c8d2f42..0751e77 100644 --- a/tests/scsi/rc +++ b/tests/scsi/rc @@ -15,7 +15,7 @@ group_device_requires() { } _have_scsi_generic() { - _have_modules sg + _have_driver sg } _require_test_dev_is_scsi() { From patchwork Mon May 30 13:08:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C7C8C433F5 for ; Mon, 30 May 2022 13:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236328AbiE3NIk (ORCPT ); Mon, 30 May 2022 09:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236326AbiE3NIi (ORCPT ); Mon, 30 May 2022 09:08:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C49E819A9 for ; Mon, 30 May 2022 06:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=rVtv4hqHRIiBfzH3a3TRr9+YdmhHgE1PAv/ncRPpl0c=; b=vgYdLq5ebdLT8QuOVdfk/w6P7H 7F0UH+QioeAmdGSQd+s4KmwM7JqPpckR7eG7PYuI0xf8g99kjVJyps9QkIgPCB24M4p+wCAbKA5lc FZnfBwk94/hlQJfFUirmllyN/eiDPwG69LCCr1La6P2+eWr+CR29ZYIxw3BkMxBi7FzbOOck49NBb 5e2xsq2Fy1HvkYV1yvYMWGLeGutQulhexcei/T3KSrS9IAjBphOBYJy6sS5TPuF+DXLJ0hw2+hPAL OOeH3M8XpFb1D+lX+6MQ7skon3sIvnnBKSAoxpt0e8IL2pUklUDJP/NYjJzdTgoFYEq8G7F28OpbB /61fygnA==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8O-006bs9-FD; Mon, 30 May 2022 13:08:36 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 8/9] nvme: don't require the nvme drivers to be built in Date: Mon, 30 May 2022 15:08:10 +0200 Message-Id: <20220530130811.3006554-9-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules to check for the availability of the nvme drivers, and don't bother checking at all for drivers that are pulled in as dependencies. Signed-off-by: Christoph Hellwig --- tests/nvme/rc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index ccdccf9..998b181 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -16,21 +16,23 @@ _nvme_requires() { _have_program nvme case ${nvme_trtype} in loop) - _have_modules nvmet nvme-core nvme-loop + _have_driver nvme-loop _have_configfs ;; pci) - _have_modules nvme nvme-core + _have_driver nvme ;; tcp) - _have_modules nvmet nvme-core nvme-tcp nvmet-tcp + _have_driver nvme-tcp + _have_driver nvmet-tcp _have_configfs ;; rdma) - _have_modules nvmet nvme-core nvme-rdma nvmet-rdma + _have_driver nvme-rdma + _have_driver nvmet-rdma _have_configfs _have_program rdma - _have_modules rdma_rxe || _have_modules siw + _have_driver rdma_rxe || _have_driver siw ;; *) SKIP_REASON="unsupported nvme_trtype=${nvme_trtype}" @@ -125,11 +127,11 @@ _cleanup_nvmet() { shopt -u nullglob trap SIGINT - modprobe -r nvme-"${nvme_trtype}" 2>/dev/null + modprobe -rq nvme-"${nvme_trtype}" 2>/dev/null if [[ "${nvme_trtype}" != "loop" ]]; then - modprobe -r nvmet-"${nvme_trtype}" 2>/dev/null + modprobe -rq nvmet-"${nvme_trtype}" 2>/dev/null fi - modprobe -r nvmet 2>/dev/null + modprobe -rq nvmet 2>/dev/null if [[ "${nvme_trtype}" == "rdma" ]]; then stop_soft_rdma fi @@ -137,11 +139,11 @@ _cleanup_nvmet() { _setup_nvmet() { _register_test_cleanup _cleanup_nvmet - modprobe nvmet + modprobe -q nvmet if [[ "${nvme_trtype}" != "loop" ]]; then - modprobe nvmet-"${nvme_trtype}" + modprobe -q nvmet-"${nvme_trtype}" fi - modprobe nvme-"${nvme_trtype}" + modprobe -q nvme-"${nvme_trtype}" if [[ "${nvme_trtype}" == "rdma" ]]; then start_soft_rdma for i in $(rdma_network_interfaces) From patchwork Mon May 30 13:08:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12864628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BD66C433F5 for ; Mon, 30 May 2022 13:08:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236326AbiE3NIn (ORCPT ); Mon, 30 May 2022 09:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236332AbiE3NIl (ORCPT ); Mon, 30 May 2022 09:08:41 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3317091E for ; Mon, 30 May 2022 06:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=hF0N8d1hVFIfQRMHICovfH2QmOFI1XtKqCkbbhP/EgM=; b=yLL4t3YzDiE7Bt9kJT73Pc1W/u zwHrOvXh2XSUsyaAmabmx4TPGgyRgYA6+j+8RB2KAVwusPLzZdFUX6FMBxPZHDLOa7lxz9BcWjhm7 tsX6PauPiS3TB9ZVlLzs8KSN1exWQCWNR2OohTom7tAiT1N1PT/96q+KKxRBASmJnV9T8cx2l+Iri M8A4APyJqhU/JpmyCvOUgO3FHzrXs2vQCLPJHFHXpVGP3FtzHsoOmkpU7B0CEZ68cy3c4KES8KCUq MjOQelqyabvcn8dkcGE9GIk5RgwZbcg6/k7x6/y/m4L5IQBfbbueIW8hI/ywjglisTpdJB3Y8ZD+G Qhsbt/kg==; Received: from [2001:4bb8:185:a81e:fda9:da32:3b0c:8358] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvf8R-006bt8-2u; Mon, 30 May 2022 13:08:39 +0000 From: Christoph Hellwig To: Shin'ichiro Kawasaki Cc: linux-block@vger.kernel.org Subject: [PATCH blktests 9/9] common: do not require scsi_debug support to be modular Date: Mon, 30 May 2022 15:08:11 +0200 Message-Id: <20220530130811.3006554-10-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220530130811.3006554-1-hch@lst.de> References: <20220530130811.3006554-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Use _have_driver instead of _have_modules in _have_scsi_debug for the basic scsi_debug check, and instead only require an actual module in _init_null_blk when specific module parameters are passed. Signed-off-by: Christoph Hellwig --- common/scsi_debug | 14 ++++++++++---- tests/block/001 | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/common/scsi_debug b/common/scsi_debug index 95da14e..e9161d3 100644 --- a/common/scsi_debug +++ b/common/scsi_debug @@ -5,7 +5,7 @@ # scsi_debug helper functions. _have_scsi_debug() { - _have_modules scsi_debug + _have_driver scsi_debug } _init_scsi_debug() { @@ -18,8 +18,14 @@ _init_scsi_debug() { args+=(zbc=host-managed zone_nr_conv=0) fi - if ! modprobe -r scsi_debug || ! modprobe scsi_debug "${args[@]}"; then - return 1 + if ((${#args[@]})); then + if ! modprobe -qr scsi_debug; then + exit 1 + fi + if ! modprobe scsi_debug "${args[@]}"; then + SKIP_REASON="scsi_debug not modular" + return 1 + fi fi udevadm settle @@ -60,5 +66,5 @@ _exit_scsi_debug() { unset SCSI_DEBUG_TARGETS unset SCSI_DEBUG_DEVICES udevadm settle - modprobe -r scsi_debug + modprobe -rq scsi_debug } diff --git a/tests/block/001 b/tests/block/001 index 5f05fa8..fb93932 100755 --- a/tests/block/001 +++ b/tests/block/001 @@ -13,7 +13,9 @@ DESCRIPTION="stress device hotplugging" TIMED=1 requires() { - _have_scsi_debug && _have_modules sd_mod sr_mod + _have_scsi_debug + _have_driver sd_mod + _have_driver sr_mod } stress_scsi_debug() {