Re: enclosure: fix sysfs symlinks creation when using multipath

2017-06-26 Thread Douglas Miller
On 06/20/2017 06:38 AM, Maurizio Lombardi wrote: Dne 16.6.2017 v 18:08 Douglas Miller napsal(a): Just to respond to James' question on the cause. What I observed was a race condition between udevd (ses_init()) and a worker thread (do_scan_async()), where the worker thread is creating the direc

Re: enclosure: fix sysfs symlinks creation when using multipath

2017-06-20 Thread Maurizio Lombardi
Dne 16.6.2017 v 18:08 Douglas Miller napsal(a): > Just to respond to James' question on the cause. What I observed was a race > condition between udevd (ses_init()) and a worker thread (do_scan_async()), > where the worker thread is creating the directories that are the target of > the symlinks

Re: enclosure: fix sysfs symlinks creation when using multipath

2017-06-16 Thread Douglas Miller
On 06/16/2017 10:41 AM, Douglas Miller wrote: On 03/16/2017 01:49 PM, James Bottomley wrote: On Wed, 2017-03-15 at 19:39 -0400, Martin K. Petersen wrote: Maurizio Lombardi writes: With multipath, it may happen that the same device is passed to enclosure_add_device() multiple times and that t

Re: enclosure: fix sysfs symlinks creation when using multipath

2017-06-16 Thread Douglas Miller
On 03/16/2017 01:49 PM, James Bottomley wrote: On Wed, 2017-03-15 at 19:39 -0400, Martin K. Petersen wrote: Maurizio Lombardi writes: With multipath, it may happen that the same device is passed to enclosure_add_device() multiple times and that the enclosure_add_links() function fails to crea

Re: [RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-06-16 Thread Douglas Miller
On 06/16/2017 07:48 AM, Maurizio Lombardi wrote: Dne 16.6.2017 v 14:40 Douglas Miller napsal(a): I'd like to add that we are seeing this problem with singlepath installations and need to get this fixed upstream as soon as possible. RHEL new product contains this fix and is working for us, but

Re: [RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-06-16 Thread Maurizio Lombardi
Dne 16.6.2017 v 14:40 Douglas Miller napsal(a): > > I'd like to add that we are seeing this problem with singlepath installations > and need to get this fixed upstream as soon as possible. RHEL new product > contains this fix and is working for us, but we need to be able to offer > other dist

Re: [RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-06-16 Thread Douglas Miller
On 02/07/2017 08:08 AM, Maurizio Lombardi wrote: With multipath, it may happen that the same device is passed to enclosure_add_device() multiple times and that the enclosure_add_links() function fails to create the symlinks because the device's sysfs directory entry is still NULL. In this case, t

Re: [PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-28 Thread Maurizio Lombardi
Dne 21.3.2017 v 10:58 Maurizio Lombardi napsal(a): > I will ask our customer to test your patch, > there is only a small problem: you can't set cdev->dev = NULL > and then call enclosure_add_links(cdev) because you will end up dereferencing > a NULL pointer. > I suggest a slightly different patc

Re: [PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-21 Thread Maurizio Lombardi
Dne 16.3.2017 v 19:49 James Bottomley napsal(a): > diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c > index 65fed71..ae89082 100644 > --- a/drivers/misc/enclosure.c > +++ b/drivers/misc/enclosure.c > @@ -375,6 +375,7 @@ int enclosure_add_device(struct enclosure_device *edev, > i

Re: [PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-16 Thread James Bottomley
On Wed, 2017-03-15 at 19:39 -0400, Martin K. Petersen wrote: > Maurizio Lombardi writes: > > > With multipath, it may happen that the same device is passed to > > enclosure_add_device() multiple times and that the > > enclosure_add_links() function fails to create the symlinks because > > the dev

Re: [PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-15 Thread Martin K. Petersen
Maurizio Lombardi writes: > With multipath, it may happen that the same device is passed to > enclosure_add_device() multiple times and that the > enclosure_add_links() function fails to create the symlinks because > the device's sysfs directory entry is still NULL. In this case, the > links wil

[PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-02 Thread Maurizio Lombardi
With multipath, it may happen that the same device is passed to enclosure_add_device() multiple times and that the enclosure_add_links() function fails to create the symlinks because the device's sysfs directory entry is still NULL. In this case, the links will never be created because all the subs

Re: [PATCH RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-02-16 Thread Maurizio Lombardi
Hi James, have you noticed this patch? Dne 7.2.2017 v 15:08 Maurizio Lombardi napsal(a): > With multipath, it may happen that the same device is passed > to enclosure_add_device() multiple times and that the enclosure_add_links() > function fails to create the symlinks because the device's sysfs

[PATCH RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-02-07 Thread Maurizio Lombardi
With multipath, it may happen that the same device is passed to enclosure_add_device() multiple times and that the enclosure_add_links() function fails to create the symlinks because the device's sysfs directory entry is still NULL. In this case, the links will never be created because all the subs