]> granicus.if.org Git - zfs/commitdiff
OpenZFS 7867 - ARC space accounting leak
authorAndriy Gapon <avg@FreeBSD.org>
Mon, 27 Feb 2017 22:47:33 +0000 (14:47 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Mar 2017 02:14:32 +0000 (18:14 -0800)
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Tim Chase <tim@chase2k.com>
Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
OpenZFS-issue: https://www.illumos.org/issues/7867
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/aa1f740d
Closes #5874

module/zfs/arc.c

index 9fac5a6c42cffe21667196a1cf3b51f98e12f01e..5764a63a4bef29479a72f97d8fbbc7a698594bcf 100644 (file)
@@ -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);
 }