Re: [PATCH] zram: check comp algorithm availability earlier

2015-05-26 Thread Sergey Senozhatsky
On (05/27/15 14:58), Minchan Kim wrote: > > > I'm not against this patch because it's better than old. > > > But let's think more about the pr_err part. > > > > > > If user try to set wrong algo name, he can see EINVAL. > > > Isn't it enough? > > > > > > I think every sane admin can think he pass

Re: [PATCH] zram: check comp algorithm availability earlier

2015-05-26 Thread Minchan Kim
On Wed, May 27, 2015 at 02:53:20PM +0900, Sergey Senozhatsky wrote: > On (05/27/15 12:51), Minchan Kim wrote: > [..] > > > @@ -378,6 +378,12 @@ static ssize_t comp_algorithm_store(struct device > > > *dev, > > > if (sz > 0 && zram->compressor[sz - 1] == '\n') > > > zram->compressor[sz

Re: [PATCH] zram: check comp algorithm availability earlier

2015-05-26 Thread Sergey Senozhatsky
On (05/27/15 12:51), Minchan Kim wrote: [..] > > @@ -378,6 +378,12 @@ static ssize_t comp_algorithm_store(struct device *dev, > > if (sz > 0 && zram->compressor[sz - 1] == '\n') > > zram->compressor[sz - 1] = 0x00; > > > > + if (!zcomp_available_algorithm(zram->compressor)) { >

Re: [PATCH] zram: check comp algorithm availability earlier

2015-05-26 Thread Minchan Kim
Hello Sergey, On Tue, May 26, 2015 at 10:13:37PM +0900, Sergey Senozhatsky wrote: > 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 d

[PATCH] zram: check comp algorithm availability earlier

2015-05-26 Thread Sergey Senozhatsky
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 prints "zram: Cannot initialise %s compressing backend" to syslog. this