From: xiubli@redhat.com
To: josef@toxicpanda.com, axboe@kernel.dk, nbd@other.debian.org
Cc: mchristi@redhat.com, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, atumball@redhat.com,
Xiubo Li <xiubli@redhat.com>
Subject: [RFC PATCH] nbd: set the default nbds_max to 0
Date: Wed, 29 May 2019 16:08:36 +0800 [thread overview]
Message-ID: <20190529080836.13031-1-xiubli@redhat.com> (raw)
From: Xiubo Li <xiubli@redhat.com>
There is one problem that when trying to check the nbd device
NBD_CMD_STATUS and at the same time insert the nbd.ko module,
we can randomly get some of the 16 /dev/nbd{0~15} are connected,
but they are not. This is because that the udev service in user
space will try to open /dev/nbd{0~15} devices to do some sanity
check when they are added in "__init nbd_init()" and then close
it asynchronousely.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
Not sure whether this patch make sense here, coz this issue can be
avoided by setting the "nbds_max=0" when inserting the nbd.ko modules.
drivers/block/nbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 4c1de1c..98be6ca 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -137,7 +137,7 @@ struct nbd_cmd {
#define NBD_DEF_BLKSIZE 1024
-static unsigned int nbds_max = 16;
+static unsigned int nbds_max;
static int max_part = 16;
static struct workqueue_struct *recv_workqueue;
static int part_shift;
@@ -2310,6 +2310,6 @@ static void __exit nbd_cleanup(void)
MODULE_LICENSE("GPL");
module_param(nbds_max, int, 0444);
-MODULE_PARM_DESC(nbds_max, "number of network block devices to initialize (default: 16)");
+MODULE_PARM_DESC(nbds_max, "number of network block devices to initialize (default: 0)");
module_param(max_part, int, 0444);
MODULE_PARM_DESC(max_part, "number of partitions per device (default: 16)");
--
1.8.3.1
next reply other threads:[~2019-05-29 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 8:08 xiubli [this message]
2019-05-29 13:48 ` Josef Bacik
2019-05-30 1:22 ` Xiubo Li
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=20190529080836.13031-1-xiubli@redhat.com \
--to=xiubli@redhat.com \
--cc=atumball@redhat.com \
--cc=axboe@kernel.dk \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchristi@redhat.com \
--cc=nbd@other.debian.org \
/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
all inboxes | Powered by JetHome®