Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 20:37:01 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329665 - head/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201802202037.w1KKb1lh057853@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Feb 20 20:37:01 2018
New Revision: 329665
URL: https://svnweb.freebsd.org/changeset/base/329665

Log:
  MFV r316901:
  7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices
  
  illumos/illumos-gate@105686550ee9cbf5d033166a8a2a5a763667d436
  https://github.com/illumos/illumos-gate/commit/105686550ee9cbf5d033166a8a2a5a763667d436
  
  https://www.illumos.org/issues/7730
    antares:root:~# mdb /usr/sbin/zpool
    > ::sysbp _exit
    > ::run import
       pool: data
         id: 2093977168778024605
      state: ONLINE
     action: The pool can be imported using its name or numeric identifier.
     config:
  
            data        ONLINE
              c6t0d0    ONLINE
              c6t1d0    ONLINE
            cache
              c6t2d0
    mdb: stop on entry to _exit
    mdb: target stopped at:
    0xfee556ba:     nop
    mdb: You've got symbols!
    Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
    libnvpair.so.1 ]
    > ::findleaks -d
    BYTES             LEAKED VMEM_SEG CALLER
    4096                  10 fda7b000 MMAP
    8192                   1 fea8d000 MMAP
    8192                   1 fe76d000 MMAP
    8192                   1 fe66e000 MMAP
    4096                   1 fe570000 MMAP
    8192                   1 fe470000 MMAP
    4096                   1 fe372000 MMAP
    4096                   1 fe273000 MMAP
  
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Yuri Pankov <yuri.pankov@nexenta.com>

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Tue Feb 20 20:34:04 2018	(r329664)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Tue Feb 20 20:37:01 2018	(r329665)
@@ -240,9 +240,12 @@ add_config(libzfs_handle_t *hdl, pool_list_t *pl, cons
 			free(ne);
 			return (-1);
 		}
+
 		ne->ne_guid = vdev_guid;
 		ne->ne_next = pl->names;
 		pl->names = ne;
+
+		nvlist_free(config);
 		return (0);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802202037.w1KKb1lh057853>