Re: [PATCH 2/2] zram: user per-cpu compression streams

From: Sergey Senozhatsky
Date: Tue May 03 2016 - 01:43:14 EST


On (05/03/16 14:23), Minchan Kim wrote:
[..]
> > - zram->max_comp_streams = num;
> > - ret = len;
> > -out:
> > - up_write(&zram->init_lock);
> > - return ret;
>
> At least, we need sanity check code, still?
> Otherwise, user can echo "garbage" > /sys/xxx/max_comp_stream" and then
> cat /sys/xxx/max_comp_stream returns num_online_cpus.

hm, I couldn't find any reason to keep the check. we completely
ignore the value anyway, cat /sys/xxx/max_comp_stream will always
return num_online_cpus(), regardless the correctness of supplied
data; `garbage', `2', `1024', `32' make no difference.

-ss