All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	Omar Sandoval <osandov@fb.com>,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	Michael Moese <mmoese@suse.de>, Theodore Ts'o <tytso@mit.edu>,
	Stephen Bates <sbates@raithlin.com>
Subject: Re: [PATCH blktests 11/12] common: Use sysfs instead of modinfo for _have_module_param()
Date: Mon, 15 Jul 2019 09:21:48 +0200	[thread overview]
Message-ID: <20190715072148.GC4495@x250> (raw)
In-Reply-To: <20190712235742.22646-12-logang@deltatee.com>

On Fri, Jul 12, 2019 at 05:57:41PM -0600, Logan Gunthorpe wrote:
> Using modinfo fails if the given module is built-in. Instead,
> just check for the parameter's existence in sysfs.
> 
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> ---
>  common/rc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 49050c71dabf..d48f73c5bf3d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -48,7 +48,7 @@ _have_modules() {
>  }
>  
>  _have_module_param() {
> -	if ! modinfo -F parm -0 "$1" | grep -q -z "^$2:"; then
> +	if ! [ -e "/sys/module/$1/parameters/$2" ]; then
>  		SKIP_REASON="$1 module does not have parameter $2"
>  		return 1
>  	fi

But this now fails if the module isn't loaded yet. IMHO we'll need to check if
"/sys/module/$1" exists and if it does check for
"/sys/module/$1/parameters/$2", if not try modinfo.

Does that make sense?

Byte,
	Johannes
-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

WARNING: multiple messages have this Message-ID (diff)
From: jthumshirn@suse.de (Johannes Thumshirn)
Subject: [PATCH blktests 11/12] common: Use sysfs instead of modinfo for _have_module_param()
Date: Mon, 15 Jul 2019 09:21:48 +0200	[thread overview]
Message-ID: <20190715072148.GC4495@x250> (raw)
In-Reply-To: <20190712235742.22646-12-logang@deltatee.com>

On Fri, Jul 12, 2019@05:57:41PM -0600, Logan Gunthorpe wrote:
> Using modinfo fails if the given module is built-in. Instead,
> just check for the parameter's existence in sysfs.
> 
> Signed-off-by: Logan Gunthorpe <logang at deltatee.com>
> ---
>  common/rc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 49050c71dabf..d48f73c5bf3d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -48,7 +48,7 @@ _have_modules() {
>  }
>  
>  _have_module_param() {
> -	if ! modinfo -F parm -0 "$1" | grep -q -z "^$2:"; then
> +	if ! [ -e "/sys/module/$1/parameters/$2" ]; then
>  		SKIP_REASON="$1 module does not have parameter $2"
>  		return 1
>  	fi

But this now fails if the module isn't loaded yet. IMHO we'll need to check if
"/sys/module/$1" exists and if it does check for
"/sys/module/$1/parameters/$2", if not try modinfo.

Does that make sense?

Byte,
	Johannes
-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2019-07-15  7:21 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 23:57 [PATCH blktests 00/12] Fix nvme block test issues Logan Gunthorpe
2019-07-12 23:57 ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 01/12] Add filter function for nvme discover Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 02/12] nvme: More agressively filter the discovery output Logan Gunthorpe
2019-07-15 23:07   ` Omar Sandoval
2019-07-15 23:07     ` Omar Sandoval
2019-07-12 23:57 ` [PATCH blktests 03/12] nvme: Add new test to verify the generation counter Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 04/12] nvme/003,004: Add missing calls to nvme disconnect Logan Gunthorpe
2019-07-12 23:57   ` [PATCH blktests 04/12] nvme/003, 004: " Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 05/12] nvme/005: Don't rely on modprobing to set the multipath paramater Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 06/12] nvme/015: Ensure the namespace is flushed not the char device Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 07/12] nvme/018: Ignore error message generated by nvme read Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-15  7:15   ` [PATCH blktests 07/12] nvme/018: Ignore error message generated by nvme read] Johannes Thumshirn
2019-07-15  7:15     ` Johannes Thumshirn
2019-07-15 15:40     ` Logan Gunthorpe
2019-07-15 15:40       ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 08/12] check: Add the ability to call a cleanup function after a test ends Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 09/12] nvme: Cleanup modprobe lines into helper functions Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 10/12] nvme: Ensure all ports and subsystems are removed on cleanup Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 11/12] common: Use sysfs instead of modinfo for _have_module_param() Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-15  7:21   ` Johannes Thumshirn [this message]
2019-07-15  7:21     ` Johannes Thumshirn
2019-07-15 15:41     ` Logan Gunthorpe
2019-07-15 15:41       ` Logan Gunthorpe
2019-07-12 23:57 ` [PATCH blktests 12/12] nvme: Ignore errors when removing modules Logan Gunthorpe
2019-07-12 23:57   ` Logan Gunthorpe
2019-07-13  0:01 ` [PATCH blktests 00/12] Fix nvme block test issues Logan Gunthorpe
2019-07-13  0:01   ` Logan Gunthorpe
2019-07-15 11:02 ` Michael Moese
2019-07-15 17:14 ` Chaitanya Kulkarni
2019-07-15 17:14   ` Chaitanya Kulkarni
2019-07-15 23:14 ` Omar Sandoval
2019-07-15 23:14   ` Omar Sandoval
2019-07-15 23:16   ` Logan Gunthorpe
2019-07-15 23:16     ` Logan Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715072148.GC4495@x250 \
    --to=jthumshirn@suse.de \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=logang@deltatee.com \
    --cc=mmoese@suse.de \
    --cc=osandov@fb.com \
    --cc=sbates@raithlin.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.