Skip to content

Commit

Permalink
OpenZFS 9688 - aggsum_fini leaks memory
Browse files Browse the repository at this point in the history
Porting Notes:
- Most of these fixes were applied in the original 37fb3e4
  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: openzfs/openzfs@29bf2d68be
Closes openzfs#8042
  • Loading branch information
pcd1193182 authored and Gregor Kopka committed Jan 7, 2019
1 parent ccc1d65 commit 1d31cd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion module/zfs/aggsum.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 6 additions & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1d31cd0

Please sign in to comment.