linux-stable/drivers/block/zram
Minchan Kim 553a561363 zram: close udev startup race condition as default groups
commit fef912bf86 upstream.
commit 98af4d4df8 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] fef912bf86, block: genhd: add 'groups' argument to device_add_disk
[2] 98af4d4df8, 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] 33863c21e6, Staging: zram: Replace ioctls with sysfs interface

Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Hannes Reinecke <hare@suse.com>
Tested-by: Howard Chen <howardsoc@google.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-27 16:09:40 +01:00
..
Kconfig zram: delete custom lzo/lz4 2016-07-26 16:19:19 -07:00
Makefile zram: delete custom lzo/lz4 2016-07-26 16:19:19 -07:00
zcomp.c zram: drop gfp_t from zcomp_strm_alloc() 2016-07-26 16:19:19 -07:00
zcomp.h zram: delete custom lzo/lz4 2016-07-26 16:19:19 -07:00
zram_drv.c zram: close udev startup race condition as default groups 2018-11-27 16:09:40 +01:00
zram_drv.h zram: use crypto api to check alg availability 2016-07-26 16:19:19 -07:00