[dm-devel] Bisected, with rfc/patch - was Re: BUG: unable to handle kernel NULL pointer dereference at sysfs_do_create_link_sd (after mdadm)
Christoph Hellwig
hch at lst.de
Thu Apr 23 16:10:51 UTC 2015
On Thu, Apr 23, 2015 at 06:03:14PM +1000, NeilBrown wrote:
> On Thu, 23 Apr 2015 09:37:24 +0200 Christoph Hellwig <hch at lst.de> wrote:
>
> > Plase fix your device name lifetimes.
>
> Any chance you could be more explicit?
>
> The commit you identified doesn't seem to help much - md and dm are quite
> different in this area.
>
> It seems that it is no longer safe to call 'add_disk' between calling
> 'del_gendisk' and bdi_destroy being called. How can I find out if I am in
> that window, or wait for bdi_destroy to be called?
The bdi is only around if the device is open, either through a device
node, or through a blkdev_get from a file system. If you get duplicate
names that means you're trying to allocate a new gendisk while the old
one is still around.
In theory you're fine once the device gets ->release called.
Except that we can hold sysfs reference to the qeue, eww. So for now
try to follow the dm model, but I'll need to add a callback to the
queue called once the request_queue actually is released for this.
More information about the dm-devel
mailing list