summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authortuxoko <[email protected]>2015-10-30 14:34:22 -0700
committerNed Bass <[email protected]>2015-12-23 17:29:35 -0800
commitbecc31dda7a310dc69b39d7a177c55c04f1f5c9b (patch)
tree759bb8877fcd5b65ea8c3fc9b36f5aafb2caaa35 /module
parentd8ac2b39c93f4e6b2bf2dad6ac6ce581a71ac45d (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')
-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 b759e6483..ec9b46b02 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]);