From owner-svn-src-vendor@freebsd.org Sat Apr 15 17:03:17 2017 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C3B3D3E56D; Sat, 15 Apr 2017 17:03:17 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A79DD0B; Sat, 15 Apr 2017 17:03:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (58-7-95-3.dyn.iinet.net.au [58.7.95.3]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3FH3AXw079539 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 15 Apr 2017 10:03:13 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r316930 - vendor-sys/illumos/dist/uts/common/fs/zfs To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201704141843.v3EIhAA2079997@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Sun, 16 Apr 2017 01:03:04 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704141843.v3EIhAA2079997@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Apr 2017 17:03:17 -0000 MFCs to 11 and 10 for all this stuff you've done? On 15/4/17 2:43 am, Andriy Gapon wrote: > Author: avg > Date: Fri Apr 14 18:43:10 2017 > New Revision: 316930 > URL: https://svnweb.freebsd.org/changeset/base/316930 > > Log: > 5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. > > illumos/illumos-gate@b67dde11a73a9455d641403cbbb65ec2add41b41 > https://github.com/illumos/illumos-gate/commit/b67dde11a73a9455d641403cbbb65ec2add41b41 > > https://www.illumos.org/issues/5814 > Lets pull in this patch from freebsd: > http://svnweb.freebsd.org/base?view=revision&revision=271781 > bpobj_iterate_impl(): Close a refcount leak iterating on a sublist. > If bpobj_space() returned non-zero here, the sublist would have been > left open, along with the bonus buffer hold it requires. This call > does not invoke any calls to bpobj_close() itself. > This bug doesn't have any known vector, but was found on inspection. > MFC after: 1 week > Sponsored by: Spectra Logic > Affects: All ZFS versions starting 21 May 2010 (illumos cde58dbc) > MFSpectraBSD: r1050998 on 2014/03/26 > Fix bpobj_iterate_impl() to properly call bpobj_close() if bpobj_space() > returns an error. > > Reviewed by: Prakash Surya > Reviewed by: Matthew Ahrens > Reviewed by: Paul Dagnelie > Reviewed by: Simon Klinkert > Approved by: Gordon Ross > Author: Will Andrews > > Modified: > vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:41:37 2017 (r316929) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Fri Apr 14 18:43:10 2017 (r316930) > @@ -301,8 +301,10 @@ bpobj_iterate_impl(bpobj_t *bpo, bpobj_i > if (free) { > err = bpobj_space(&sublist, > &used_before, &comp_before, &uncomp_before); > - if (err) > + if (err != 0) { > + bpobj_close(&sublist); > break; > + } > } > err = bpobj_iterate_impl(&sublist, func, arg, tx, free); > if (free) { > >