Skip to content

Commit

Permalink
Fix null pointer in arc_kmem_reap_now on 32-bit
Browse files Browse the repository at this point in the history
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 <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3973
  • Loading branch information
tuxoko authored and behlendorf committed Nov 20, 2015
1 parent d287880 commit d0c614e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit d0c614e

Please sign in to comment.