aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Dagnelie <[email protected]>2018-05-23 10:32:31 -0700
committerBrian Behlendorf <[email protected]>2018-10-19 12:08:03 -0700
commitae3d8491427343904c66d69ba94731553727eb26 (patch)
tree4f481a9a02b13f5ea4e338a927b3142a0704f5bb
parent9b2266e3d80994b21c452f67856010b566420831 (diff)
OpenZFS 9688 - aggsum_fini leaks memory
Porting Notes: - Most of these fixes were applied in the original 37fb3e43 commit when this change was ported for Linux. Authored by: Paul Dagnelie <[email protected]> Reviewed by: Serapheim Dimitropoulos <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Reviewed by: Prashanth Sreenivasa <[email protected]> Reviewed by: Jorgen Lundman <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Reviewed by: George Melikov <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/9688 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/29bf2d68be Closes #8042
-rw-r--r--module/zfs/aggsum.c2
-rw-r--r--module/zfs/arc.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/module/zfs/aggsum.c b/module/zfs/aggsum.c
index 8d310e004..ace3a83a5 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 <sys/zfs_context.h>
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 07612468d..96557054c 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);
}