mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, Karel Zak <kzak@redhat.com>
Subject: [PATCH] block: move blk_register_queue() before uevent is send out
Date: Fri, 30 Jul 2010 10:59:43 +0200	[thread overview]
Message-ID: <1280480383.1851.2.camel@yio.site> (raw)

From: Kay Sievers <kay.sievers@vrfy.org>
Subject: block: move blk_register_queue() before uevent is send out

Sysfs attributes should be created before the device is announced to
userspace. Createing attributes after the event makes it impossible
to use them reliably from udev.

The issue was found by Karel.

Cc: Karel Zak <kzak@redhat.com>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
---
 block/genhd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/block/genhd.c
+++ b/block/genhd.c
@@ -531,6 +531,7 @@ static void register_disk(struct gendisk
 #endif
 	disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
 	disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
+	blk_register_queue(disk);
 
 	/* No minors to use for partitions */
 	if (!disk_partitionable(disk))
@@ -602,7 +603,6 @@ void add_disk(struct gendisk *disk)
 	blk_register_region(disk_devt(disk), disk->minors, NULL,
 			    exact_match, exact_lock, disk);
 	register_disk(disk);
-	blk_register_queue(disk);
 
 	bdi = &disk->queue->backing_dev_info;
 	bdi_register_dev(bdi, disk_devt(disk));



                 reply	other threads:[~2010-07-30  8:59 UTC|newest]

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

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=1280480383.1851.2.camel@yio.site \
    --to=kay.sievers@vrfy.org \
    --cc=axboe@kernel.dk \
    --cc=kzak@redhat.com \
    --cc=linux-kernel@vger.kernel.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®