Fam Zheng
2016-Jun-30 06:35 UTC
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
On Wed, 06/29 23:24, Christoph Hellwig wrote:> On Thu, Jun 30, 2016 at 09:59:41AM +0800, Fam Zheng wrote: > > Documentation/kobject.txt: > > > Use the KOBJ_ADD action for when the kobject is first added to the kernel. > > > This should be done only after any attributes or children of the kobject > > > have been initialized properly, as userspace will instantly start to look > > > for them when this call happens. > > > > Unfortunately it seems impossible to fix this generally without touching the > > offending callers. The approach I'm proposing here is adding a flag to > > suppress uevent in add_disk(), which is patch 1, then in later patches, convert > > any caller to only trigger the uevent when attributes are added. > > We (or rather Dan) is touching most add_disk callers anyway for the > driverfs_dev removal. Let's just pass the array of attributes to > a disk_add variant and solve the issue for real.I thought about that. Its usage is more compact compared to this series, but is also more code and less flexible IMO. For example, we need at least two variants, for attribute_group and device_attribute separately, right? Fam
Christoph Hellwig
2016-Jun-30 06:38 UTC
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote:> 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.
Fam Zheng
2016-Jul-01 01:01 UTC
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
On Wed, 06/29 23:38, Christoph Hellwig wrote:> On Thu, Jun 30, 2016 at 02:35:54PM +0800, Fam Zheng wrote: > > 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)? Fam
Seemingly Similar Threads
- [PATCH v2 00/12] gendisk: Generate uevent after attribute available
- [PATCH v2 00/12] gendisk: Generate uevent after attribute available
- [PATCH v2 00/12] gendisk: Generate uevent after attribute available
- [PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
- [PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes