From owner-svn-src-head@freebsd.org Tue Jun 21 19:03:26 2016 Return-Path: Delivered-To: svn-src-head@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 48FB1AC56FB; Tue, 21 Jun 2016 19:03:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E65B325F3; Tue, 21 Jun 2016 19:03:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5LJ3K8F099569 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 21 Jun 2016 22:03:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5LJ3K8F099569 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5LJ3KOP099568; Tue, 21 Jun 2016 22:03:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 21 Jun 2016 22:03:20 +0300 From: Konstantin Belousov To: Andriy Gapon Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r301929 - head/sys/kern Message-ID: <20160621190320.GF38613@kib.kiev.ua> References: <201606151556.u5FFu3pt032257@repo.freebsd.org> <5200834c-c3d4-6331-eecb-155e6453ba96@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5200834c-c3d4-6331-eecb-155e6453ba96@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 19:03:26 -0000 On Tue, Jun 21, 2016 at 09:49:24PM +0300, Andriy Gapon wrote: > On 15/06/2016 18:56, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jun 15 15:56:03 2016 > > New Revision: 301929 > > URL: https://svnweb.freebsd.org/changeset/base/301929 > > > > Log: > > Do not assume that we own the use reference on the covered vnode until > > we set MNTK_UNMOUNT flag on the mp. Otherwise parallel unmount which > > wins race with us could dereference the covered vnode, and we are > > left with the locked freed memory. > > > > Reported and tested by: pho > > Sponsored by: The FreeBSD Foundation > > Approved by: re (gjb) > > MFC after: 1 week > > > Kostik, > > does this change fix (or is likely to fix) the following panic? Yes, this is exactly the problem that was reported, Peter made sure that he is able to reproduce the issue at will, and that the patch fixed it. > Thanks! > > VNASSERT failed > 0xfffff8000c926588: tag none, type VBAD > usecount 0, writecount 0, refcount 0 mountedhere 0 > VNASSERT failed > 0xfffff8000e95f000: tag none, type VBAD > usecount 0, writecount 0, refcount 0 mountedhere 0 > flags () > lock type zfs: EXCL by thread 0xfffff80020921a00 (pid 2017, zfs, tid > 100794) > panic: No vop_unlock(0xfffff8000e95f000, 0xfffffe004df8a980) > cpuid = 2 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe004df8a820 > vpanic() at vpanic+0x182/frame 0xfffffe004df8a8a0 > kassert_panic() at kassert_panic+0x126/frame 0xfffffe004df8a910 > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x94/frame 0xfffffe004df8a940 > dounmount() at dounmount+0x138/frame 0xfffffe004df8a9c0 > sys_unmount() at sys_unmount+0x35d/frame 0xfffffe004df8aae0 > amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe004df8abf0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe004df8abf0 > --- syscall (22, FreeBSD ELF64, sys_unmount), rip = 0x8012f4e4a, rsp = > 0x7fffffffc298, rbp = 0x7fffffffc300 --- > KDB: enter: panic > [ thread pid 2017 tid 100794 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > > P.S. Not sure why two VNASSERTs are reported here, but this is copied > verbatim from a console. Most likely you got two CPUs checking the same assert, but only one was able to enter the panic state. Look at the backtraces of running threads on other processors. > > > Modified: > > head/sys/kern/vfs_mount.c > > > -- > Andriy Gapon