summaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authortuxoko <[email protected]>2015-10-30 14:34:22 -0700
committerBrian Behlendorf <[email protected]>2015-11-19 16:01:47 -0800
commitd0c614ecf9eb0b5f5c5d75316c2faeff63e03c4e (patch)
tree89bf3c17a4bb93d5986e9c65a70fac535ebba966 /module/zfs/arc.c
parentd287880afd843bd8c0cbcabe514b65083d1a0090 (diff)
Fix null pointer in arc_kmem_reap_now on 32-bit
On 32 bit system, zio_buf_cache is limit to 1M. Larger than that is all NULL. So we need to avoid reaping them. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #3973
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 06fb72b60..c1e0bfbba 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -3373,6 +3373,11 @@ arc_kmem_reap_now(void)
}
for (i = 0; i < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT; i++) {
+#ifdef _ILP32
+ /* reach upper limit of cache size on 32-bit */
+ if (zio_buf_cache[i] == NULL)
+ break;
+#endif
if (zio_buf_cache[i] != prev_cache) {
prev_cache = zio_buf_cache[i];
kmem_cache_reap_now(zio_buf_cache[i]);