linux-stable/drivers/block/zram
Luis Henriques 1d5b43bfb6 zram: introduce comp algorithm fallback functionality
When the user supplies an unsupported compression algorithm, keep the
previously selected one (knowingly supported) or the default one (if the
compression algorithm hasn't been changed yet).

Note that previously this operation (i.e. setting an invalid algorithm)
would result in no algorithm being selected, which means that this
represents a small change in the default behaviour.

Minchan said:

For initializing zram, we need to set up 3 optional parameters in advance.

1. the number of compression streams
2. memory limitation
3. compression algorithm

Although user pass completely wrong value to set up for 1 and 2
parameters, it's okay because they have default value so zram will be
initialized with the default value (of course, when user passes a wrong
value via *echo*, sysfs returns -EINVAL so the user can notice it).

But 3 is not consistent with other optional parameters.  IOW, if the
user passes a wrong value to set up 3 parameter, zram's initialization
would fail unlike other optional parameters.

So this patch makes them consistent.

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-06 17:50:42 -08:00
..
Kconfig zram: remove obsolete ZRAM_DEBUG option 2015-06-25 17:00:35 -07:00
Makefile zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp.c zram: fix possible use after free in zcomp_create() 2015-09-17 21:16:07 -07:00
zcomp.h zram: check comp algorithm availability earlier 2015-06-25 17:00:37 -07:00
zcomp_lz4.c zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lz4.h zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lzo.c zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zcomp_lzo.h zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zram_drv.c zram: introduce comp algorithm fallback functionality 2015-11-06 17:50:42 -08:00
zram_drv.h zsmalloc/zram: introduce zs_pool_stats api 2015-09-08 15:35:28 -07:00