Linux-Block Archive on
 help / color / Atom feed
From: Hou Tao <>
To: <>
Cc: Jens Axboe <>
Subject: [PATCH] block: genhd: skip blk_register_region() for disk using ext-dev
Date: Mon, 11 Nov 2019 09:49:46 +0800
Message-ID: <> (raw)

It doesn't incur any harm now when the range parameter of
blk_register_region() is zero, but let's skip the useless call of
blk_register_region() for disk which uses ext-dev.

Signed-off-by: Hou Tao <>
 block/genhd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 26b31fcae217..c61b59b550b0 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -739,8 +739,9 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
 		ret = bdi_register_owner(disk->queue->backing_dev_info,
-		blk_register_region(disk_devt(disk), disk->minors, NULL,
-				    exact_match, exact_lock, disk);
+		if (disk->minors)
+			blk_register_region(disk_devt(disk), disk->minors, NULL,
+						exact_match, exact_lock, disk);
 	register_disk(parent, disk, groups);
 	if (register_queue)

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically 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:

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

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Block Archive on

Archives are clonable:
	git clone --mirror 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/ \
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone