Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1475493 > unrolled thread

Re: [PATCH] virtio-blk: Generate uevent after attribute available

Started by"Michael S. Tsirkin" <mst@redhat.com>
First post2016-09-03 01:00 +0200
Last post2016-09-03 09:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] virtio-blk: Generate uevent after attribute available "Michael S. Tsirkin" <mst@redhat.com> - 2016-09-03 01:00 +0200
    Re: [PATCH] virtio-blk: Generate uevent after attribute available Fam Zheng <famz@redhat.com> - 2016-09-03 09:20 +0200

#1475493 — Re: [PATCH] virtio-blk: Generate uevent after attribute available

From"Michael S. Tsirkin" <mst@redhat.com>
Date2016-09-03 01:00 +0200
SubjectRe: [PATCH] virtio-blk: Generate uevent after attribute available
Message-ID<sd5Bf-5vL-3@gated-at.bofh.it>
On Wed, Jun 29, 2016 at 09:24:15AM +0800, Fam Zheng wrote:
> 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 hot plugging a number of
> > > virtio-blk disks.
> > > 
> > > Also in systemd, there used to be a related workaround in udev rules
> > > called 'WAIT_FOR="serial"', but it is removed in later versions.
> > > 
> > > Now let's generate a KOBJ_CHANGE event after the attributes are ready.
> > 
> > The same race is present in other drivers as well, e.g. nvme.  Please
> > find a way to make this work properly without needing to hack every
> > driver to send events manually.
> 
> OK, I'll take a look today!
> 
> Fam

Was this fixed in the generic code?

-- 
MST

[toc] | [next] | [standalone]


#1475567

FromFam Zheng <famz@redhat.com>
Date2016-09-03 09:20 +0200
Message-ID<sddp8-2bY-3@gated-at.bofh.it>
In reply to#1475493
On Sat, 09/03 01:56, Michael S. Tsirkin wrote:
> On Wed, Jun 29, 2016 at 09:24:15AM +0800, Fam Zheng wrote:
> > 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 hot plugging a number of
> > > > virtio-blk disks.
> > > > 
> > > > Also in systemd, there used to be a related workaround in udev rules
> > > > called 'WAIT_FOR="serial"', but it is removed in later versions.
> > > > 
> > > > Now let's generate a KOBJ_CHANGE event after the attributes are ready.
> > > 
> > > The same race is present in other drivers as well, e.g. nvme.  Please
> > > find a way to make this work properly without needing to hack every
> > > driver to send events manually.
> > 
> > OK, I'll take a look today!
> > 
> > Fam
> 
> Was this fixed in the generic code?

A proposed fix is:

https://lkml.org/lkml/2016/8/17/81

Fam

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web