summaryrefslogtreecommitdiffstats
path: root/module/zfs/arc.c
diff options
context:
space:
mode:
authorAndriy Gapon <[email protected]>2017-02-27 14:47:33 -0800
committerBrian Behlendorf <[email protected]>2017-03-07 18:14:32 -0800
commit423e7b62613d0a359e488cf2599a44174d073805 (patch)
tree7c91fef459a31ed87723ea159c9e0d745936a7c4 /module/zfs/arc.c
parentdb4ed56538db7fa3ec63bf279b8a2a1311991bed (diff)
OpenZFS 7867 - ARC space accounting leak
Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Tim Chase <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7867 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/aa1f740d Closes #5874
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r--module/zfs/arc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c
index 9fac5a6c4..5764a63a4 100644
--- a/module/zfs/arc.c
+++ b/module/zfs/arc.c
@@ -2510,6 +2510,12 @@ arc_hdr_free_on_write(arc_buf_hdr_t *hdr)
size, hdr);
}
(void) refcount_remove_many(&state->arcs_size, size, hdr);
+ if (type == ARC_BUFC_METADATA) {
+ arc_space_return(size, ARC_SPACE_META);
+ } else {
+ ASSERT(type == ARC_BUFC_DATA);
+ arc_space_return(size, ARC_SPACE_DATA);
+ }
l2arc_free_abd_on_write(hdr->b_l1hdr.b_pabd, size, type);
}