diff options
author | Wanpeng Li <liwanp@linux.vnet.ibm.com> | 2013-03-13 03:06:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 20:42:34 -0400 |
commit | 25eeb667599b192ea850a062d69383ee864c06ab (patch) | |
tree | f2b1f8b4a46ec9d741bbc7bb591ab7807279c83b | |
parent | dcb4e2d9bb4e3b6ad05bc513a237a87e46952341 (diff) |
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>
-rw-r--r-- | drivers/staging/zram/zram_drv.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index 5918fd7d7e36..e34e3fe0ae2e 100644 --- a/drivers/staging/zram/zram_drv.c +++ b/drivers/staging/zram/zram_drv.c | |||
@@ -207,11 +207,8 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, | |||
207 | 207 | ||
208 | ret = zram_decompress_page(zram, uncmem, index); | 208 | ret = zram_decompress_page(zram, uncmem, index); |
209 | /* Should NEVER happen. Return bio error if it does. */ | 209 | /* Should NEVER happen. Return bio error if it does. */ |
210 | if (unlikely(ret != LZO_E_OK)) { | 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); | ||
213 | goto out_cleanup; | 211 | goto out_cleanup; |
214 | } | ||
215 | 212 | ||
216 | if (is_partial_io(bvec)) | 213 | if (is_partial_io(bvec)) |
217 | memcpy(user_mem + bvec->bv_offset, uncmem + offset, | 214 | memcpy(user_mem + bvec->bv_offset, uncmem + offset, |