Re: [PATCH v2 00/12] gendisk: Generate uevent after attribute available
From: Dan Williams <hidden>
Date: 2016-07-01 01:29:31
On Thu, Jun 30, 2016 at 6:01 PM, Fam Zheng [off-list ref] wrote:
On Wed, 06/29 23:38, Christoph Hellwig wrote:quoted
On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote:quoted
also more code and less flexible IMO. For example, we need at least two variants, for attribute_group and device_attribute separately, right?Yes, or maybe just a calling convention that just passes both.OK, I can look into that, but I'm not sure about the error handling. Currently add_disk returns void, do you have any plan on that too? should I change it in v3 (to at least return the attribute creation failure)?
I think we should only support a "groups" interface to
device_add_disk() and convert all the drivers that currently do
device_create_file() after add_disk() to pass in a group list instead.
That way we follow the expectation that the only way to get an
attribute for a device to show up before KOBJ_ADD, is to define a
group:
From Documentation/driver-model/device.txt:
As explained in Documentation/kobject.txt, device attributes must be be
created before the KOBJ_ADD uevent is generated. The only way to realize
that is by defining an attribute group.
Let's defer the return value fixing for now.
You can find the pending device_add_disk() patches in the nvdimm
patchwork starting with "block: introduce device_add_disk()"
https://patchwork.kernel.org/project/linux-nvdimm/list/