Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] common/multipath-over-rdma: make block scheduler directory optional
@ 2020-07-29 15:21 Luis Chamberlain
  2020-07-30  8:12 ` Daniel Wagner
  2020-08-04 21:12 ` Omar Sandoval
  0 siblings, 2 replies; 3+ messages in thread
From: Luis Chamberlain @ 2020-07-29 15:21 UTC (permalink / raw)
  To: linux-block; +Cc: Sebastian.Chlad, daniel.wagner, hare, Luis Chamberlain

We currently fail if the following tests if the directory
/lib/modules/$(uname -r)/kernel/block does not exist. Just make
this optional. Older distributions won't have this directory.

srp/001
srp/002
srp/013
srp/014

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 common/multipath-over-rdma | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma
index 676d283..f004124 100644
--- a/common/multipath-over-rdma
+++ b/common/multipath-over-rdma
@@ -696,10 +696,13 @@ setup_test() {
 
 	# Load the I/O scheduler kernel modules
 	(
-		cd "/lib/modules/$(uname -r)/kernel/block" &&
-			for m in *.ko; do
-				[ -e "$m" ] && modprobe "${m%.ko}"
-			done
+		KERNEL_BLOCK="/lib/modules/$(uname -r)/kernel/block"
+		if [ -d $KERNEL_BLOCK ]; then
+			cd $KERNEL_BLOCK &&
+				for m in *.ko; do
+					[ -e "$m" ] && modprobe "${m%.ko}"
+				done
+		fi
 	)
 
 	if [ -d /sys/kernel/debug/dynamic_debug ]; then
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] common/multipath-over-rdma: make block scheduler directory optional
  2020-07-29 15:21 [PATCH] common/multipath-over-rdma: make block scheduler directory optional Luis Chamberlain
@ 2020-07-30  8:12 ` Daniel Wagner
  2020-08-04 21:12 ` Omar Sandoval
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Wagner @ 2020-07-30  8:12 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: linux-block, Sebastian.Chlad, daniel.wagner, hare, osandov

Hi Luis,

[cc: Omar]

blktests patches should have a 'PATCH blktests' subject prefix.

On Wed, Jul 29, 2020 at 03:21:13PM +0000, Luis Chamberlain wrote:
> We currently fail if the following tests if the directory
> /lib/modules/$(uname -r)/kernel/block does not exist. Just make
> this optional. Older distributions won't have this directory.

It's not just older distributions. If the I/O schedulers are build in
there wont be any block directory.

> srp/001
> srp/002
> srp/013
> srp/014
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Reviewed-by: Daniel Wagner <dwagner@suse.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] common/multipath-over-rdma: make block scheduler directory optional
  2020-07-29 15:21 [PATCH] common/multipath-over-rdma: make block scheduler directory optional Luis Chamberlain
  2020-07-30  8:12 ` Daniel Wagner
@ 2020-08-04 21:12 ` Omar Sandoval
  1 sibling, 0 replies; 3+ messages in thread
From: Omar Sandoval @ 2020-08-04 21:12 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: linux-block, Sebastian.Chlad, daniel.wagner, hare

On Wed, Jul 29, 2020 at 03:21:13PM +0000, Luis Chamberlain wrote:
> We currently fail if the following tests if the directory
> /lib/modules/$(uname -r)/kernel/block does not exist. Just make
> this optional. Older distributions won't have this directory.
> 
> srp/001
> srp/002
> srp/013
> srp/014
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>  common/multipath-over-rdma | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/common/multipath-over-rdma b/common/multipath-over-rdma
> index 676d283..f004124 100644
> --- a/common/multipath-over-rdma
> +++ b/common/multipath-over-rdma
> @@ -696,10 +696,13 @@ setup_test() {
>  
>  	# Load the I/O scheduler kernel modules
>  	(
> -		cd "/lib/modules/$(uname -r)/kernel/block" &&
> -			for m in *.ko; do
> -				[ -e "$m" ] && modprobe "${m%.ko}"
> -			done
> +		KERNEL_BLOCK="/lib/modules/$(uname -r)/kernel/block"
> +		if [ -d $KERNEL_BLOCK ]; then
> +			cd $KERNEL_BLOCK &&

This has a couple of shellcheck errors about unquoted variables. Fixed
those up and applied, thanks.

> +				for m in *.ko; do
> +					[ -e "$m" ] && modprobe "${m%.ko}"
> +				done
> +		fi
>  	)
>  
>  	if [ -d /sys/kernel/debug/dynamic_debug ]; then
> -- 
> 2.27.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 15:21 [PATCH] common/multipath-over-rdma: make block scheduler directory optional Luis Chamberlain
2020-07-30  8:12 ` Daniel Wagner
2020-08-04 21:12 ` Omar Sandoval

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git