Skip to content

Commit 25eeb66

Browse files
Wanpeng Ligregkh
authored andcommitted
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>
1 parent dcb4e2d commit 25eeb66

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/staging/zram/zram_drv.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,8 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
207207

208208
ret = zram_decompress_page(zram, uncmem, index);
209209
/* 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))
213211
goto out_cleanup;
214-
}
215212

216213
if (is_partial_io(bvec))
217214
memcpy(user_mem + bvec->bv_offset, uncmem + offset,

0 commit comments

Comments
 (0)