Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

zram: fix zram_bvec_read duplicate dump failure message and stat accumulation

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>

authored by

Wanpeng Li and committed by
Greg Kroah-Hartman
25eeb667 dcb4e2d9

+1 -4
+1 -4
drivers/staging/zram/zram_drv.c
··· 207 207 208 208 ret = zram_decompress_page(zram, uncmem, index); 209 209 /* Should NEVER happen. Return bio error if it does. */ 210 - if (unlikely(ret != LZO_E_OK)) { 211 - pr_err("Decompression failed! err=%d, page=%u\n", ret, index); 212 - zram_stat64_inc(zram, &zram->stats.failed_reads); 210 + if (unlikely(ret != LZO_E_OK)) 213 211 goto out_cleanup; 214 - } 215 212 216 213 if (is_partial_io(bvec)) 217 214 memcpy(user_mem + bvec->bv_offset, uncmem + offset,