From owner-svn-src-vendor@freebsd.org Sun Aug 9 19:12:44 2015 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 3E5A399D9BF; Sun, 9 Aug 2015 19:12:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1045720B; Sun, 9 Aug 2015 19:12:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t79JChAL085927; Sun, 9 Aug 2015 19:12:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t79JCh5D085926; Sun, 9 Aug 2015 19:12:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201508091912.t79JCh5D085926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 9 Aug 2015 19:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r286538 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 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: Sun, 09 Aug 2015 19:12:44 -0000 Author: mav Date: Sun Aug 9 19:12:43 2015 New Revision: 286538 URL: https://svnweb.freebsd.org/changeset/base/286538 Log: 5562 ZFS sa_handle's violate kmem invariants, debug kernels panic on boot Reviewed by: Matthew Ahrens Reviewed by: Robert Mustacchi Reviewed by: George Wilson Reviewed by: Rich Lowe Approved by: Dan McDonald Author: Justin T. Gibbs illumos/illumos-gate@0fda3cc5c1c5a1d9bdea6d52637bef6e781549c9 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Sun Aug 9 19:07:24 2015 (r286537) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Sun Aug 9 19:12:43 2015 (r286538) @@ -211,13 +211,6 @@ sa_cache_constructor(void *buf, void *un { sa_handle_t *hdl = buf; - hdl->sa_dbu.dbu_evict_func = NULL; - hdl->sa_bonus_tab = NULL; - hdl->sa_spill_tab = NULL; - hdl->sa_os = NULL; - hdl->sa_userp = NULL; - hdl->sa_bonus = NULL; - hdl->sa_spill = NULL; mutex_init(&hdl->sa_lock, NULL, MUTEX_DEFAULT, NULL); return (0); } @@ -227,7 +220,6 @@ static void sa_cache_destructor(void *buf, void *unused) { sa_handle_t *hdl = buf; - hdl->sa_dbu.dbu_evict_func = NULL; mutex_destroy(&hdl->sa_lock); } @@ -1351,14 +1343,11 @@ sa_handle_destroy(sa_handle_t *hdl) mutex_enter(&hdl->sa_lock); (void) dmu_buf_remove_user(db, &hdl->sa_dbu); - if (hdl->sa_bonus_tab) { + if (hdl->sa_bonus_tab) sa_idx_tab_rele(hdl->sa_os, hdl->sa_bonus_tab); - hdl->sa_bonus_tab = NULL; - } - if (hdl->sa_spill_tab) { + + if (hdl->sa_spill_tab) sa_idx_tab_rele(hdl->sa_os, hdl->sa_spill_tab); - hdl->sa_spill_tab = NULL; - } dmu_buf_rele(hdl->sa_bonus, NULL); @@ -1392,10 +1381,13 @@ sa_handle_get_from_db(objset_t *os, dmu_ sa_handle_t *winner = NULL; handle = kmem_cache_alloc(sa_cache, KM_SLEEP); + handle->sa_dbu.dbu_evict_func = NULL; handle->sa_userp = userp; handle->sa_bonus = db; handle->sa_os = os; handle->sa_spill = NULL; + handle->sa_bonus_tab = NULL; + handle->sa_spill_tab = NULL; error = sa_build_index(handle, SA_BONUS);