Skip to content

Commit

Permalink
zram: fix zram_bvec_read duplicate dump failure message and stat accu…
Browse files Browse the repository at this point in the history
…mulation

When zram decompress fails, the code unnecessarily dumps failure messages and
does stat accumulation in function zram_decompress_page(), this work is already
done in function zram_decompress_page, the patch skips the redundant work.

Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wanpeng Li authored and Greg Kroah-Hartman committed Mar 19, 2013
1 parent dcb4e2d commit 25eeb66
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/staging/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,8 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,

ret = zram_decompress_page(zram, uncmem, index);
/* Should NEVER happen. Return bio error if it does. */
if (unlikely(ret != LZO_E_OK)) {
pr_err("Decompression failed! err=%d, page=%u\n", ret, index);
zram_stat64_inc(zram, &zram->stats.failed_reads);
if (unlikely(ret != LZO_E_OK))
goto out_cleanup;
}

if (is_partial_io(bvec))
memcpy(user_mem + bvec->bv_offset, uncmem + offset,
Expand Down

0 comments on commit 25eeb66

Please sign in to comment.