diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-29 19:28:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-29 19:28:29 -0400 |
commit | 10f3291a1d7a7dc3ded403cb3caa31916364be60 (patch) | |
tree | dc642b00558988f3e6a98d33a8f8299fc88444c3 /drivers/block | |
parent | 878e580e211c519c1b32a2c65786d308a759ec24 (diff) | |
parent | b0108f9e93d0d39050eaa11358852f349bdccb71 (diff) |
Merge branch 'akpm' (fixes from Andrew Morton)
Merge patches from Andrew Morton:
"22 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (22 commits)
kexec: purgatory: add clean-up for purgatory directory
Documentation/kdump/kdump.txt: add ARM description
flush_icache_range: export symbol to fix build errors
tools: selftests: fix build issue with make kselftests target
ocfs2: quorum: add a log for node not fenced
ocfs2: o2net: set tcp user timeout to max value
ocfs2: o2net: don't shutdown connection when idle timeout
ocfs2: do not write error flag to user structure we cannot copy from/to
x86/purgatory: use approprate -m64/-32 build flag for arch/x86/purgatory
drivers/rtc/rtc-s5m.c: re-add support for devices without irq specified
xattr: fix check for simultaneous glibc header inclusion
kexec: remove CONFIG_KEXEC dependency on crypto
kexec: create a new config option CONFIG_KEXEC_FILE for new syscall
x86,mm: fix pte_special versus pte_numa
hugetlb_cgroup: use lockdep_assert_held rather than spin_is_locked
mm/zpool: use prefixed module loading
zram: fix incorrect stat with failed_reads
lib: turn CONFIG_STACKTRACE into an actual option.
mm: actually clear pmd_numa before invalidating
memblock, memhotplug: fix wrong type in memblock_find_in_range_node().
...
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/zram/zram_drv.c | 10 | ||||
-rw-r--r-- | drivers/block/zram/zram_drv.h | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index dfa4024c448a..d00831c3d731 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c | |||
@@ -378,7 +378,6 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) | |||
378 | /* Should NEVER happen. Return bio error if it does. */ | 378 | /* Should NEVER happen. Return bio error if it does. */ |
379 | if (unlikely(ret)) { | 379 | if (unlikely(ret)) { |
380 | pr_err("Decompression failed! err=%d, page=%u\n", ret, index); | 380 | pr_err("Decompression failed! err=%d, page=%u\n", ret, index); |
381 | atomic64_inc(&zram->stats.failed_reads); | ||
382 | return ret; | 381 | return ret; |
383 | } | 382 | } |
384 | 383 | ||
@@ -547,8 +546,6 @@ out: | |||
547 | zcomp_strm_release(zram->comp, zstrm); | 546 | zcomp_strm_release(zram->comp, zstrm); |
548 | if (is_partial_io(bvec)) | 547 | if (is_partial_io(bvec)) |
549 | kfree(uncmem); | 548 | kfree(uncmem); |
550 | if (ret) | ||
551 | atomic64_inc(&zram->stats.failed_writes); | ||
552 | return ret; | 549 | return ret; |
553 | } | 550 | } |
554 | 551 | ||
@@ -566,6 +563,13 @@ static int zram_bvec_rw(struct zram *zram, struct bio_vec *bvec, u32 index, | |||
566 | ret = zram_bvec_write(zram, bvec, index, offset); | 563 | ret = zram_bvec_write(zram, bvec, index, offset); |
567 | } | 564 | } |
568 | 565 | ||
566 | if (unlikely(ret)) { | ||
567 | if (rw == READ) | ||
568 | atomic64_inc(&zram->stats.failed_reads); | ||
569 | else | ||
570 | atomic64_inc(&zram->stats.failed_writes); | ||
571 | } | ||
572 | |||
569 | return ret; | 573 | return ret; |
570 | } | 574 | } |
571 | 575 | ||
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h index 5b0afde729cd..e0f725c87cc6 100644 --- a/drivers/block/zram/zram_drv.h +++ b/drivers/block/zram/zram_drv.h | |||
@@ -84,7 +84,7 @@ struct zram_stats { | |||
84 | atomic64_t compr_data_size; /* compressed size of pages stored */ | 84 | atomic64_t compr_data_size; /* compressed size of pages stored */ |
85 | atomic64_t num_reads; /* failed + successful */ | 85 | atomic64_t num_reads; /* failed + successful */ |
86 | atomic64_t num_writes; /* --do-- */ | 86 | atomic64_t num_writes; /* --do-- */ |
87 | atomic64_t failed_reads; /* should NEVER! happen */ | 87 | atomic64_t failed_reads; /* can happen when memory is too low */ |
88 | atomic64_t failed_writes; /* can happen when memory is too low */ | 88 | atomic64_t failed_writes; /* can happen when memory is too low */ |
89 | atomic64_t invalid_io; /* non-page-aligned I/O requests */ | 89 | atomic64_t invalid_io; /* non-page-aligned I/O requests */ |
90 | atomic64_t notify_free; /* no. of swap slot free notifications */ | 90 | atomic64_t notify_free; /* no. of swap slot free notifications */ |