[dm-devel] [PATCH 1/3] Send KOBJ_ADD event after dm resume ioctl.

Milan Broz mbroz at redhat.com
Fri Mar 19 09:10:05 UTC 2010


On 03/19/2010 09:27 AM, Kay Sievers wrote:
> On Thu, Mar 18, 2010 at 22:35, Milan Broz <mbroz at redhat.com> wrote:

> /sys is the direct export of kernel objects, if you create objects,
> they appear, and they get announced. If you don't want them to be
> announced at that time, just don't register them at that time.

Well, again, I used something what is already used (not on many places,
but it is there), just search for dev_set_uevent_suppress().

See

/* delay uevents, until we scanned partition table */
dev_set_uevent_suppress(ddev, 1);

... (part table scan etc. it reads disk, so there can be
significant delay if device retries read for example)

+ /* caller will send ADD event later */
+ if (disk->flags & GENHD_FL_SUPPRESS_ADD_EVENT)
+ return;
+
/* announce disk after possible partitions are created */
dev_set_uevent_suppress(ddev, 0);
kobject_uevent(&ddev->kobj, KOBJ_ADD);


So the comment says that base device is announced after all
partitions devices are created.

I thought it is exactly the same model I used - so there is for
some time unannounced fully created "dead" device in sysfs.

Probably I am still missing where the problem is - the ADD
event is sent later, so the problem in time interval?
Or the atomicity of the call?

Well, if it is not acceptable (is this what you want to say?),
what do you suggest?

Not use add_disk()/del_gendisk() in dm core and rewrite it?
This seems like change a lot of code. And after that someone
surely will say "why dm implements this differently".

But I think it always need a change in device core code.

Thanks,
Milan
--
mbroz at redhat.com




More information about the dm-devel mailing list