Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-16 Thread Minchan Kim
On Thu, Nov 15, 2018 at 12:45:04PM -0500, Sasha Levin wrote:
> On Wed, Nov 14, 2018 at 02:52:23PM +0900, Minchan Kim wrote:
> > commit fef912bf860e upstream.
> > commit 98af4d4df889 upstream.
> > 
> > I got a report from Howard Chen that he saw zram and sysfs race(ie,
> > zram block device file is created but sysfs for it isn't yet)
> > when he tried to create new zram devices via hotadd knob.
> > 
> > v4.20 kernel fixes it by [1, 2] but it's too large size to merge
> > into -stable so this patch fixes the problem by registering defualt
> > group by Greg KH's approach[3].
> > 
> > This patch should be applied to every stable tree [3.16+] currently
> > existing from kernel.org because the problem was introduced at 2.6.37
> > by [4].
> > 
> > [1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
> > [2] 98af4d4df889, zram: register default groups with device_add_disk()
> > [3] 
> > http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
> > [4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface
> > 
> > Cc: Sergey Senozhatsky 
> > Cc: Hannes Reinecke 
> > Tested-by: Howard Chen 
> > Signed-off-by: Minchan Kim 
> 
> I've queued this for 4.19 and 4.18, but it doesn't apply to anything
> older than that.

Thanks for the review, Hannes.

Sasha, I will send separate patches for older stable kernel.
Thanks for picking the patch.

> 
> --
> Thanks,
> Sasha


Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-16 Thread Minchan Kim
On Thu, Nov 15, 2018 at 12:45:04PM -0500, Sasha Levin wrote:
> On Wed, Nov 14, 2018 at 02:52:23PM +0900, Minchan Kim wrote:
> > commit fef912bf860e upstream.
> > commit 98af4d4df889 upstream.
> > 
> > I got a report from Howard Chen that he saw zram and sysfs race(ie,
> > zram block device file is created but sysfs for it isn't yet)
> > when he tried to create new zram devices via hotadd knob.
> > 
> > v4.20 kernel fixes it by [1, 2] but it's too large size to merge
> > into -stable so this patch fixes the problem by registering defualt
> > group by Greg KH's approach[3].
> > 
> > This patch should be applied to every stable tree [3.16+] currently
> > existing from kernel.org because the problem was introduced at 2.6.37
> > by [4].
> > 
> > [1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
> > [2] 98af4d4df889, zram: register default groups with device_add_disk()
> > [3] 
> > http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
> > [4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface
> > 
> > Cc: Sergey Senozhatsky 
> > Cc: Hannes Reinecke 
> > Tested-by: Howard Chen 
> > Signed-off-by: Minchan Kim 
> 
> I've queued this for 4.19 and 4.18, but it doesn't apply to anything
> older than that.

Thanks for the review, Hannes.

Sasha, I will send separate patches for older stable kernel.
Thanks for picking the patch.

> 
> --
> Thanks,
> Sasha


Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-15 Thread Sasha Levin

On Wed, Nov 14, 2018 at 02:52:23PM +0900, Minchan Kim wrote:

commit fef912bf860e upstream.
commit 98af4d4df889 upstream.

I got a report from Howard Chen that he saw zram and sysfs race(ie,
zram block device file is created but sysfs for it isn't yet)
when he tried to create new zram devices via hotadd knob.

v4.20 kernel fixes it by [1, 2] but it's too large size to merge
into -stable so this patch fixes the problem by registering defualt
group by Greg KH's approach[3].

This patch should be applied to every stable tree [3.16+] currently
existing from kernel.org because the problem was introduced at 2.6.37
by [4].

[1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
[2] 98af4d4df889, zram: register default groups with device_add_disk()
[3] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
[4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface

Cc: Sergey Senozhatsky 
Cc: Hannes Reinecke 
Tested-by: Howard Chen 
Signed-off-by: Minchan Kim 


I've queued this for 4.19 and 4.18, but it doesn't apply to anything
older than that.

--
Thanks,
Sasha


Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-15 Thread Sasha Levin

On Wed, Nov 14, 2018 at 02:52:23PM +0900, Minchan Kim wrote:

commit fef912bf860e upstream.
commit 98af4d4df889 upstream.

I got a report from Howard Chen that he saw zram and sysfs race(ie,
zram block device file is created but sysfs for it isn't yet)
when he tried to create new zram devices via hotadd knob.

v4.20 kernel fixes it by [1, 2] but it's too large size to merge
into -stable so this patch fixes the problem by registering defualt
group by Greg KH's approach[3].

This patch should be applied to every stable tree [3.16+] currently
existing from kernel.org because the problem was introduced at 2.6.37
by [4].

[1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
[2] 98af4d4df889, zram: register default groups with device_add_disk()
[3] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
[4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface

Cc: Sergey Senozhatsky 
Cc: Hannes Reinecke 
Tested-by: Howard Chen 
Signed-off-by: Minchan Kim 


I've queued this for 4.19 and 4.18, but it doesn't apply to anything
older than that.

--
Thanks,
Sasha


Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-13 Thread Hannes Reinecke

On 11/14/18 6:52 AM, Minchan Kim wrote:

commit fef912bf860e upstream.
commit 98af4d4df889 upstream.

I got a report from Howard Chen that he saw zram and sysfs race(ie,
zram block device file is created but sysfs for it isn't yet)
when he tried to create new zram devices via hotadd knob.

v4.20 kernel fixes it by [1, 2] but it's too large size to merge
into -stable so this patch fixes the problem by registering defualt
group by Greg KH's approach[3].

This patch should be applied to every stable tree [3.16+] currently
existing from kernel.org because the problem was introduced at 2.6.37
by [4].

[1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
[2] 98af4d4df889, zram: register default groups with device_add_disk()
[3] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
[4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface

Cc: Sergey Senozhatsky 
Cc: Hannes Reinecke 
Tested-by: Howard Chen 
Signed-off-by: Minchan Kim 
---
  drivers/block/zram/zram_drv.c | 26 ++
  1 file changed, 6 insertions(+), 20 deletions(-)

Actually, I have a similar patch for NVMe in older revisions, so maybe I 
should push it to -stable, too.


Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
--
Dr. Hannes ReineckezSeries & Storage
h...@suse.com  +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-13 Thread Hannes Reinecke

On 11/14/18 6:52 AM, Minchan Kim wrote:

commit fef912bf860e upstream.
commit 98af4d4df889 upstream.

I got a report from Howard Chen that he saw zram and sysfs race(ie,
zram block device file is created but sysfs for it isn't yet)
when he tried to create new zram devices via hotadd knob.

v4.20 kernel fixes it by [1, 2] but it's too large size to merge
into -stable so this patch fixes the problem by registering defualt
group by Greg KH's approach[3].

This patch should be applied to every stable tree [3.16+] currently
existing from kernel.org because the problem was introduced at 2.6.37
by [4].

[1] fef912bf860e, block: genhd: add 'groups' argument to device_add_disk
[2] 98af4d4df889, zram: register default groups with device_add_disk()
[3] http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/
[4] 33863c21e69e9, Staging: zram: Replace ioctls with sysfs interface

Cc: Sergey Senozhatsky 
Cc: Hannes Reinecke 
Tested-by: Howard Chen 
Signed-off-by: Minchan Kim 
---
  drivers/block/zram/zram_drv.c | 26 ++
  1 file changed, 6 insertions(+), 20 deletions(-)

Actually, I have a similar patch for NVMe in older revisions, so maybe I 
should push it to -stable, too.


Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
--
Dr. Hannes ReineckezSeries & Storage
h...@suse.com  +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)