The patch titled Subject: zram: introduce comp algorithm fallback functionality has been added to the -mm tree. Its filename is zram-introduce-comp-algorithm-fallback-functionality.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/zram-introduce-comp-algorithm-fallback-functionality.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/zram-introduce-comp-algorithm-fallback-functionality.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Luis Henriques <luis.henriques@xxxxxxxxxxxxx> Subject: 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. Signed-off-by: Luis Henriques <luis.henriques@xxxxxxxxxxxxx> Acked-by: Minchan Kim <minchan@xxxxxxxxxx> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/block/zram/zram_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -puN drivers/block/zram/zram_drv.c~zram-introduce-comp-algorithm-fallback-functionality drivers/block/zram/zram_drv.c --- a/drivers/block/zram/zram_drv.c~zram-introduce-comp-algorithm-fallback-functionality +++ a/drivers/block/zram/zram_drv.c @@ -365,6 +365,9 @@ static ssize_t comp_algorithm_store(stru struct zram *zram = dev_to_zram(dev); size_t sz; + if (!zcomp_available_algorithm(buf)) + return -EINVAL; + down_write(&zram->init_lock); if (init_done(zram)) { up_write(&zram->init_lock); @@ -378,9 +381,6 @@ static ssize_t comp_algorithm_store(stru if (sz > 0 && zram->compressor[sz - 1] == '\n') zram->compressor[sz - 1] = 0x00; - if (!zcomp_available_algorithm(zram->compressor)) - len = -EINVAL; - up_write(&zram->init_lock); return len; } _ Patches currently in -mm which might be from luis.henriques@xxxxxxxxxxxxx are zram-fix-possible-use-after-free-in-zcomp_create.patch zram-introduce-comp-algorithm-fallback-functionality.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html