Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-30 Thread Nitin Gupta
On 10/30/2012 02:04 PM, Sergey Senozhatsky wrote: On (10/29/12 10:14), Nitin Gupta wrote: == zram: Fix use-after-free in partial I/O case When the compressed size of a page exceeds a threshold, the page is stored as-is i.e. in uncompressed form. In the partial I/O i.e. non-PAGE_SIZE'ed I/O

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-30 Thread Sergey Senozhatsky
On (10/29/12 10:14), Nitin Gupta wrote: > == > zram: Fix use-after-free in partial I/O case > > When the compressed size of a page exceeds a threshold, the page is > stored as-is i.e. in uncompressed form. In the partial I/O i.e. > non-PAGE_SIZE'ed I/O case, however, the uncompressed memory wa

[PATCH 1/2] zram: factor-out zram_decompress_page() function (resend)

2012-10-30 Thread Sergey Senozhatsky
zram_bvec_read() shared decompress functionality with zram_read_before_write() function. Factor-out and make commonly used zram_decompress_page() function, which also simplified error handling in zram_bvec_read(). Signed-off-by: Sergey Senozhatsky Reviewed-by: Nitin Gupta --- drivers/stagin

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-30 Thread Greg Kroah-Hartman
On Tue, Oct 30, 2012 at 09:58:42PM +0300, Sergey Senozhatsky wrote: > zram: factor-out zram_decompress_page() function What's with the indentation? And including the Subject: again here? > > zram_bvec_read() shared decompress functionality with > zram_read_before_write() function. > Fact

[PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-30 Thread Sergey Senozhatsky
zram: factor-out zram_decompress_page() function zram_bvec_read() shared decompress functionality with zram_read_before_write() function. Factor-out and make commonly used zram_decompress_page() function, which also simplified error handling in zram_bvec_read(). Signed-off-by: Sergey

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function (v3)

2012-10-29 Thread Sergey Senozhatsky
zram: factor-out zram_decompress_page() function zram_bvec_read() shared decompress functionality with zram_read_before_write() function. Factor-out and make commonly used zram_decompress_page() function, which also simplified error handling in zram_bvec_read(). v3: remove debug messa

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function (v2)

2012-10-29 Thread Sergey Senozhatsky
On (10/29/12 11:32), Nitin Gupta wrote: > > Nothing should be printed (even a debug only message) for > the ZRAM_ZERO case. This case can be quite common for certain > kinds of data and would cause a huge log spew. Also (!handle) case > is not the same as zero-filled page case, so this message wo

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function (v2)

2012-10-29 Thread Nitin Gupta
On Mon, Oct 29, 2012 at 11:05 AM, Sergey Senozhatsky wrote: > zram: factor-out zram_decompress_page() function > > zram_bvec_read() shared decompress functionality with > zram_read_before_write() function. > Factor-out and make commonly used zram_decompress_page() function, which > also si

[PATCH 1/2] zram: factor-out zram_decompress_page() function (v2)

2012-10-29 Thread Sergey Senozhatsky
zram: factor-out zram_decompress_page() function zram_bvec_read() shared decompress functionality with zram_read_before_write() function. Factor-out and make commonly used zram_decompress_page() function, which also simplified error handling in zram_bvec_read(). V2: changed debug mess

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-29 Thread Sergey Senozhatsky
On (10/29/12 10:14), Nitin Gupta wrote: > > "Read before write" message is not valid in case ZRAM_ZERO flag is > set. Its true only in !handle case. > do we actually need this message? > Otherwise, the patch looks good to me. > > On a side note, zram still contains a known use-after-free bug

Re: [PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-29 Thread Nitin Gupta
On 10/27/2012 09:00 AM, Sergey Senozhatsky wrote: zram: factor-out zram_decompress_page() function zram_bvec_read() shared decompress functionality with zram_read_before_write() function. Factor-out and make commonly used zram_decompress_page() function, which also simplified error

[PATCH 1/2] zram: factor-out zram_decompress_page() function

2012-10-27 Thread Sergey Senozhatsky
zram: factor-out zram_decompress_page() function zram_bvec_read() shared decompress functionality with zram_read_before_write() function. Factor-out and make commonly used zram_decompress_page() function, which also simplified error handling in zram_bvec_read(). Signed-off-by: Ser