lkml.org 
[lkml]   [2015]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] zram: check compressor name before setting it
Hi,

On 22/05/15 10:56, Sergey Senozhatsky wrote:
> On (05/22/15 10:31), Marcin Jabrzyk wrote:
>> Zram sysfs interface was not making any check of
>> proper compressor name when setting it.
>> Any name is accepted, but further tries of device
>> creation would end up with not very meaningfull error.
>> eg.
>>
>> echo lz0 > comp_algorithm
>> echo 200M > disksize
>> echo: write error: Invalid argument
>>
>
> no.
>
> zram already complains about failed comp backend creation.
> it's in dmesg (or syslog, etc.):
>
> "zram: Cannot initialise %s compressing backend"
>
OK, now I see that. Sorry for the noise.

> second, there is not much value in exposing zcomp internals,
> especially when the result is just another line in dmesg output.

From the other hand, the only valid values that can be written are
in 'comp_algorithm'.
So when writing other one, returning -EINVAL seems to be reasonable.
The user would get immediately information that he can't do that,
now the information can be very deferred in time.
I'm not for exposing more internals, but getting -EINVAL would be nice I
think.

>
> -ss
>

Best regards,
Marcin Jabrzyk


\
 
 \ /
  Last update: 2015-05-22 11:21    [W:0.088 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site