Displaying 20 results from an estimated 46 matches for "kobj_add".
2016 Jun 30
17
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
The race condition is noticed between disk_add() and disk attributes, on
virtio-blk hotplug.
Userspace listens to the KOBJ_ADD uevent generated in add_disk(). At that
point we haven't created the serial attribute file, therefore depending
on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
created.
As pointed out by Christoph Hellwig in the specific fix [1], virtio-blk is not
the only driver tha...
2016 Jun 30
17
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
The race condition is noticed between disk_add() and disk attributes, on
virtio-blk hotplug.
Userspace listens to the KOBJ_ADD uevent generated in add_disk(). At that
point we haven't created the serial attribute file, therefore depending
on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
created.
As pointed out by Christoph Hellwig in the specific fix [1], virtio-blk is not
the only driver tha...
2016 Jun 30
1
[PATCH v2 04/12] axonrom: Generate uevent after attribute available
On Wed, Jun 29, 2016 at 6:59 PM, Fam Zheng <famz at redhat.com> wrote:
> It is documented that KOBJ_ADD should be generated after the object's
> attributes and children are ready. We can achieve this with the new
> disk_gen_uevents interface.
>
> Signed-off-by: Fam Zheng <famz at redhat.com>
> ---
> arch/powerpc/sysdev/axonram.c | 3 ++-
> 1 file changed, 2 insertions...
2016 Jun 30
1
[PATCH v2 04/12] axonrom: Generate uevent after attribute available
On Wed, Jun 29, 2016 at 6:59 PM, Fam Zheng <famz at redhat.com> wrote:
> It is documented that KOBJ_ADD should be generated after the object's
> attributes and children are ready. We can achieve this with the new
> disk_gen_uevents interface.
>
> Signed-off-by: Fam Zheng <famz at redhat.com>
> ---
> arch/powerpc/sysdev/axonram.c | 3 ++-
> 1 file changed, 2 insertions...
2016 Jun 30
0
[PATCH v2 02/12] genhd: Honor gen_uevent and add disk_gen_uevents
...63,6 +561,22 @@ static void register_disk(struct gendisk *disk)
exit:
/* announce disk after possible partitions are created */
dev_set_uevent_suppress(ddev, 0);
+ if (gen_uevent)
+ disk_gen_uevents(disk);
+}
+
+/**
+ * disk_gen_uevents
+ * @disk - the disk to generate uevent
+ *
+ * Generate KOBJ_ADD uevents on the disk and partitions.
+ */
+void disk_gen_uevents(struct gendisk *disk)
+{
+ struct device *ddev = disk_to_dev(disk);
+ struct disk_part_iter piter;
+ struct hd_struct *part;
+
kobject_uevent(&ddev->kobj, KOBJ_ADD);
/* announce possible partitions */
@@ -571,6 +585,7 @@ e...
2016 Jun 28
2
[PATCH] virtio-blk: Generate uevent after attribute available
Userspace listens to the KOBJ_ADD uevent generated in add_disk. At that
point we haven't created the serial attribute file, therefore depending
on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
created.
This race condition can be easily reproduced by hot plugging a number of
virtio-blk disks.
Also in...
2016 Jun 28
2
[PATCH] virtio-blk: Generate uevent after attribute available
Userspace listens to the KOBJ_ADD uevent generated in add_disk. At that
point we haven't created the serial attribute file, therefore depending
on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
created.
This race condition can be easily reproduced by hot plugging a number of
virtio-blk disks.
Also in...
2016 Jun 29
2
[PATCH] virtio-blk: Generate uevent after attribute available
On Tue, 06/28 04:45, Christoph Hellwig wrote:
> On Tue, Jun 28, 2016 at 10:39:15AM +0800, Fam Zheng wrote:
> > Userspace listens to the KOBJ_ADD uevent generated in add_disk. At that
> > point we haven't created the serial attribute file, therefore depending
> > on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
> > created.
> >
> > This race condition can be easily reproduced by ho...
2016 Jun 29
2
[PATCH] virtio-blk: Generate uevent after attribute available
On Tue, 06/28 04:45, Christoph Hellwig wrote:
> On Tue, Jun 28, 2016 at 10:39:15AM +0800, Fam Zheng wrote:
> > Userspace listens to the KOBJ_ADD uevent generated in add_disk. At that
> > point we haven't created the serial attribute file, therefore depending
> > on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
> > created.
> >
> > This race condition can be easily reproduced by ho...
2016 Jul 01
1
[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
2016 Jul 01
1
[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
2016 Aug 17
20
[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
This is an attempt to fix the issue that some disks' sysfs attributes are not
ready at the time its KOBJ_ADD event is sent.
The symptom is during device hotplug, udev may fail to find certain attributes,
such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are
not created.
The cause is device_add_disk emits the uevent before returning, and the callers
have to create sysfs entries...
2016 Aug 17
20
[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
This is an attempt to fix the issue that some disks' sysfs attributes are not
ready at the time its KOBJ_ADD event is sent.
The symptom is during device hotplug, udev may fail to find certain attributes,
such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are
not created.
The cause is device_add_disk emits the uevent before returning, and the callers
have to create sysfs entries...
2016 Jun 28
0
[PATCH] virtio-blk: Generate uevent after attribute available
On Tue, Jun 28, 2016 at 10:39:15AM +0800, Fam Zheng wrote:
> Userspace listens to the KOBJ_ADD uevent generated in add_disk. At that
> point we haven't created the serial attribute file, therefore depending
> on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get
> created.
>
> This race condition can be easily reproduced by hot plugging a number of
&g...
2016 Jun 30
0
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
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 see...
2016 Jun 30
2
[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.
> >
>...
2016 Jun 30
0
[PATCH v2 04/12] axonrom: Generate uevent after attribute available
It is documented that KOBJ_ADD should be generated after the object's
attributes and children are ready. We can achieve this with the new
disk_gen_uevents interface.
Signed-off-by: Fam Zheng <famz at redhat.com>
---
arch/powerpc/sysdev/axonram.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/a...
2016 Jun 30
0
[PATCH v2 05/12] aoeblk: Generate uevent after attribute available
It is documented that KOBJ_ADD should be generated after the object's
attributes and children are ready. We can achieve this with the new
disk_gen_uevents interface.
Signed-off-by: Fam Zheng <famz at redhat.com>
---
drivers/block/aoe/aoeblk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/driv...
2016 Aug 17
0
[PATCH 08/15] nvme: Pass attribute group to device_add_disk
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditionally.
device_add_disk can handle adding attribute group...
2016 Aug 17
0
[PATCH 11/15] zram: Pass attribute group to device_add_disk
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditionally.
device_add_disk can handle adding attribute group...