Sergey Senozhatsky d93435c3fb zram: check comp algorithm availability earlier
Improvement idea by Marcin Jabrzyk.

comp_algorithm_store() silently accepts any supplied algorithm name,
because zram performs algorithm availability check later, during the
device configuration phase in disksize_store() and emits the following
error:

  "zram: Cannot initialise %s compressing backend"

this error line is somewhat generic and, besides, can indicate a failed
attempt to allocate compression backend's working buffers.

add algorithm availability check to comp_algorithm_store():

  echo lzz > /sys/block/zram0/comp_algorithm
  -bash: echo: write error: Invalid argument

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Marcin Jabrzyk <m.jabrzyk@samsung.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-06-25 17:00:37 -07:00
..
2015-06-10 22:46:34 -07:00
2015-06-23 17:25:32 -07:00
2015-06-24 08:46:32 -07:00
2015-06-22 15:15:36 +02:00
2015-06-23 13:39:56 -07:00
2015-06-23 17:31:27 -07:00
2015-05-23 12:30:52 +01:00
2015-06-23 18:27:19 -07:00
2015-06-13 08:44:14 -07:00
2015-06-19 17:10:30 +10:00
2015-06-24 08:46:32 -07:00
2015-06-19 01:18:43 +02:00
2015-06-23 13:32:38 -07:00
2015-06-23 17:31:27 -07:00
2015-06-23 15:55:44 -07:00
2015-06-24 08:46:32 -07:00
2015-06-24 18:57:00 -07:00
2015-06-24 17:49:45 -07:00