diff --git a/module/zfs/aggsum.c b/module/zfs/aggsum.c index 8d310e0043fe..ace3a83a5d8b 100644 --- a/module/zfs/aggsum.c +++ b/module/zfs/aggsum.c @@ -13,7 +13,7 @@ * CDDL HEADER END */ /* - * Copyright (c) 2017 by Delphix. All rights reserved. + * Copyright (c) 2017, 2018 by Delphix. All rights reserved. */ #include diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 07612468dcb5..96557054cc60 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -7845,8 +7845,13 @@ arc_fini(void) cv_destroy(&arc_reclaim_thread_cv); cv_destroy(&arc_reclaim_waiters_cv); - arc_state_fini(); + /* + * buf_fini() must proceed arc_state_fini() because buf_fin() may + * trigger the release of kmem magazines, which can callback to + * arc_space_return() which accesses aggsums freed in act_state_fini(). + */ buf_fini(); + arc_state_fini(); ASSERT0(arc_loaned_bytes); }