Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
Hi, On (05/25/15 23:21), Minchan Kim wrote: [..] > find_backend is just utility function to get zcomp_backend. > IOW, it might be used for several cases in future so I want > make error report as caller's work. [..] > > if (sz > 0 && zram->compressor[sz - 1] == '\n') > >

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Minchan Kim
On Mon, May 25, 2015 at 03:18:38PM +0900, Sergey Senozhatsky wrote: > On (05/22/15 15:26), Marcin Jabrzyk wrote: > > >> 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Minchan Kim
Hello Sergey, On Mon, May 25, 2015 at 01:03:04PM +0900, Sergey Senozhatsky wrote: > On (05/22/15 22:14), Minchan Kim wrote: > > > > >second, there is not much value in exposing zcomp internals, > > > > >especially when the result is just another line in dmesg output. > > > > > > > > From the

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Marcin Jabrzyk
On 25/05/15 09:34, Sergey Senozhatsky wrote: On (05/25/15 09:15), Marcin Jabrzyk wrote: [..] I'm perfectly fine with this solution. It just does what I'd expect. cool, let's hear from Minchan. btw, if we decide to move on, how do you guys want to route it? do you want Marcin (I don't

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
On (05/25/15 09:15), Marcin Jabrzyk wrote: [..] > > > I'm perfectly fine with this solution. It just does what > I'd expect. cool, let's hear from Minchan. btw, if we decide to move on, how do you guys want to route it? do you want Marcin (I don't mind) or me (of course, with the appropriate

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Marcin Jabrzyk
Hi Sergey, On 25/05/15 08:18, Sergey Senozhatsky wrote: On (05/22/15 15:26), Marcin Jabrzyk wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
On (05/25/15 15:18), Sergey Senozhatsky wrote: > find_backend() returns back to its caller a raw and completely initialized *UN-initialized. a typo. -ss -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
On (05/22/15 15:26), Marcin Jabrzyk wrote: > >> 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
On (05/25/15 15:18), Sergey Senozhatsky wrote: find_backend() returns back to its caller a raw and completely initialized *UN-initialized. a typo. -ss -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
On (05/22/15 15:26), Marcin Jabrzyk wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Marcin Jabrzyk
On 25/05/15 09:34, Sergey Senozhatsky wrote: On (05/25/15 09:15), Marcin Jabrzyk wrote: [..] I'm perfectly fine with this solution. It just does what I'd expect. cool, let's hear from Minchan. btw, if we decide to move on, how do you guys want to route it? do you want Marcin (I don't

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Marcin Jabrzyk
Hi Sergey, On 25/05/15 08:18, Sergey Senozhatsky wrote: On (05/22/15 15:26), Marcin Jabrzyk wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
On (05/25/15 09:15), Marcin Jabrzyk wrote: [..] I'm perfectly fine with this solution. It just does what I'd expect. cool, let's hear from Minchan. btw, if we decide to move on, how do you guys want to route it? do you want Marcin (I don't mind) or me (of course, with the appropriate

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Minchan Kim
Hello Sergey, On Mon, May 25, 2015 at 01:03:04PM +0900, Sergey Senozhatsky wrote: On (05/22/15 22:14), Minchan Kim wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Minchan Kim
On Mon, May 25, 2015 at 03:18:38PM +0900, Sergey Senozhatsky wrote: On (05/22/15 15:26), Marcin Jabrzyk wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-25 Thread Sergey Senozhatsky
Hi, On (05/25/15 23:21), Minchan Kim wrote: [..] find_backend is just utility function to get zcomp_backend. IOW, it might be used for several cases in future so I want make error report as caller's work. [..] if (sz 0 zram-compressor[sz - 1] == '\n') zram-compressor[sz

Re: [PATCH] zram: check compressor name before setting it

2015-05-24 Thread Sergey Senozhatsky
On (05/22/15 22:14), Minchan Kim wrote: > > > >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

Re: [PATCH] zram: check compressor name before setting it

2015-05-24 Thread Sergey Senozhatsky
On (05/22/15 22:14), Minchan Kim wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
Hello Minchan, On 22/05/15 15:14, Minchan Kim wrote: Hello Sergey, On Fri, May 22, 2015 at 09:44:11PM +0900, Sergey Senozhatsky wrote: On (05/22/15 11:12), Marcin Jabrzyk wrote: no. zram already complains about failed comp backend creation. it's in dmesg (or syslog, etc.): "zram:

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
On 22/05/15 14:44, Sergey Senozhatsky wrote: On (05/22/15 11:12), Marcin Jabrzyk wrote: 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.

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Minchan Kim
Hello Sergey, On Fri, May 22, 2015 at 09:44:11PM +0900, Sergey Senozhatsky wrote: > On (05/22/15 11:12), Marcin Jabrzyk wrote: > > > > > >no. > > > > > >zram already complains about failed comp backend creation. > > >it's in dmesg (or syslog, etc.): > > > > > > "zram: Cannot initialise %s

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Sergey Senozhatsky
On (05/22/15 11:12), Marcin Jabrzyk wrote: > > > >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

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
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.

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Sergey Senozhatsky
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 >

[PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
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 This commit

[PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
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 This commit fixes

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Sergey Senozhatsky
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

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
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.

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
On 22/05/15 14:44, Sergey Senozhatsky wrote: On (05/22/15 11:12), Marcin Jabrzyk wrote: 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.

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Minchan Kim
Hello Sergey, On Fri, May 22, 2015 at 09:44:11PM +0900, Sergey Senozhatsky wrote: On (05/22/15 11:12), Marcin Jabrzyk wrote: no. zram already complains about failed comp backend creation. it's in dmesg (or syslog, etc.): zram: Cannot initialise %s compressing backend OK,

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Sergey Senozhatsky
On (05/22/15 11:12), Marcin Jabrzyk wrote: 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

Re: [PATCH] zram: check compressor name before setting it

2015-05-22 Thread Marcin Jabrzyk
Hello Minchan, On 22/05/15 15:14, Minchan Kim wrote: Hello Sergey, On Fri, May 22, 2015 at 09:44:11PM +0900, Sergey Senozhatsky wrote: On (05/22/15 11:12), Marcin Jabrzyk wrote: no. zram already complains about failed comp backend creation. it's in dmesg (or syslog, etc.): zram: