public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <kch@nvidia.com>
To: <linux-nvme@lists.infradead.org>
Cc: <kbusch@kernel.org>, <hch@lst.de>, <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: [PATCH 0/2] nvmet-tcp: add module parameter check
Date: Sun, 26 Mar 2023 22:37:22 -0700	[thread overview]
Message-ID: <20230327053724.62363-1-kch@nvidia.com> (raw)

Hi,

Add module parameter check for the nvme-tcp target to generate right
error for negative values set by user at the time of the module
loading instaed of allowing module to be loaded with those values,
that created confusion, simple testing log :-

####################################
Without this patch series 
####################################
modprobe nvmet-tcp so_priority=-2 returned 0
modprobe nvmet-tcp so_priority=-1 returned 0
modprobe nvmet-tcp so_priority=0 returned 0
modprobe nvmet-tcp so_priority=1 returned 0
modprobe nvmet-tcp so_priority=100 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=-2 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=-1 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=0 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=1 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=100 returned 0

####################################
With this patch series 
####################################
Applying: nvmet-tcp: validate so_priority modparam value
Applying: nvmet-tcp: validate idle poll modparam value

modprobe: ERROR: could not insert 'nvmet_tcp': Invalid argument
modprobe nvmet-tcp so_priority=-2 returned 1
[21625.237738] nvmet_tcp: `-2' invalid for parameter `so_priority'

modprobe: ERROR: could not insert 'nvmet_tcp': Invalid argument
modprobe nvmet-tcp so_priority=-1 returned 1
[21625.268026] nvmet_tcp: `-1' invalid for parameter `so_priority'

modprobe nvmet-tcp so_priority=0 returned 0
modprobe nvmet-tcp so_priority=1 returned 0
modprobe nvmet-tcp so_priority=100 returned 0

modprobe: ERROR: could not insert 'nvmet_tcp': Invalid argument
modprobe nvmet-tcp idle_poll_period_usecs=-2 returned 1
[21625.412338] nvmet_tcp: `-2' invalid for parameter `idle_poll_period_usecs'

modprobe: ERROR: could not insert 'nvmet_tcp': Invalid argument
modprobe nvmet-tcp idle_poll_period_usecs=-1 returned 1
[21625.446106] nvmet_tcp: `-1' invalid for parameter `idle_poll_period_usecs'

modprobe nvmet-tcp idle_poll_period_usecs=0 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=1 returned 0
modprobe nvmet-tcp idle_poll_period_usecs=100 returned 0

-ck

Chaitanya Kulkarni (2):
  nvmet-tcp: validate so_priority modparam value
  nvmet-tcp: validate idle poll modparam value

 drivers/nvme/target/tcp.c | 34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)



-- 
2.29.0



             reply	other threads:[~2023-03-27  5:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27  5:37 Chaitanya Kulkarni [this message]
2023-03-27  5:37 ` [PATCH 1/2] nvmet-tcp: validate so_priority modparam value Chaitanya Kulkarni
2023-03-28  8:35   ` Sagi Grimberg
2023-03-27  5:37 ` [PATCH 2/2] nvmet-tcp: validate idle poll " Chaitanya Kulkarni
2023-03-28  8:36   ` Sagi Grimberg
2023-04-05 15:21 ` [PATCH 0/2] nvmet-tcp: add module parameter check Christoph Hellwig

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=20230327053724.62363-1-kch@nvidia.com \
    --to=kch@nvidia.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox