From owner-freebsd-current@FreeBSD.ORG Wed Jan 9 23:40:18 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 37D08576; Wed, 9 Jan 2013 23:40:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7F230384; Wed, 9 Jan 2013 23:40:17 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r09Ne8li016220; Thu, 10 Jan 2013 01:40:08 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r09Ne8li016220 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r09Ne7qp016151; Thu, 10 Jan 2013 01:40:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Jan 2013 01:40:07 +0200 From: Konstantin Belousov To: Florian Smeets Subject: Re: panic: vputx: missed vn_close Message-ID: <20130109234007.GJ2561@kib.kiev.ua> References: <50EDBC7B.5070408@smeets.im> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ublo+h3cBgJ33ahC" Content-Disposition: inline In-Reply-To: <50EDBC7B.5070408@smeets.im> User-Agent: Mutt/1.5.21 (2010-09-15) 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 version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: pho@freebsd.org, "current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 23:40:18 -0000 --Ublo+h3cBgJ33ahC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 09, 2013 at 07:52:43PM +0100, Florian Smeets wrote: > Hi, >=20 > I got this while building packages with poudriere. I'm running r245188. >=20 > Let me know if you need anything else from the dump. >=20 > Florian >=20 > VNASSERT failed > 0xfffffe04fda5bba0: tag zfs, type VREG > usecount 1, writecount 1, refcount 1 mountedhere 0 > flags (VI_ACTIVE) > VI_LOCKed v_object 0xfffffe062f6479f8 ref 0 pages 0 > lock type zfs: EXCL by thread 0xfffffe00bd683480 (pid 34602, umount, > tid 100578) > panic: vputx: missed vn_close > cpuid =3D 3 > Uptime: 9h25m23s > Dumping 13255 out of 32647 > MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91% >=20 > [...] >=20 > (kgdb) where > #0 doadump (textdump=3D1) at pcpu.h:229 > #1 0xffffffff804c4ab7 in kern_reboot (howto=3D260) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/kern_shutdown.c:446 > #2 0xffffffff804c4fc6 in vpanic (fmt=3D, ap=3D optimized out>) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/kern_shutdown.c:753 > #3 0xffffffff804c4e56 in kassert_panic (fmt=3D) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/kern_shutdown.c:641 > #4 0xffffffff8055714d in vputx (vp=3D0xfffffe04fda5bba0, func=3D2) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/vfs_subr.c:2243 > #5 0xffffffff80d6b42f in null_reclaim (ap=3D) at > /usr/home/flo/dev/checkouts/svn-src/sys/modules/nullfs/../../fs/nullfs/nu= ll_vnops.c:743 > #6 0xffffffff8070aee8 in VOP_RECLAIM_APV (vop=3D, > a=3D) at vnode_if.c:1959 > #7 0xffffffff8055844c in vgonel (vp=3D0xfffffe04fda5b7c0) at vnode_if.h:= 830 > #8 0xffffffff80557a7f in vflush (mp=3D0xfffffe0533ce3cc0, rootrefs=3D1, > flags=3D2, td=3D0xfffffe00bd683480) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/vfs_subr.c:2625 > #9 0xffffffff80d6aa4e in nullfs_unmount (mp=3D0xfffffe0533ce3cc0, > mntflags=3D) > at > /usr/home/flo/dev/checkouts/svn-src/sys/modules/nullfs/../../fs/nullfs/nu= ll_vfsops.c:250 > #10 0xffffffff805502cf in dounmount (mp=3D0xfffffe0533ce3cc0, > flags=3D134742016, td=3D) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/vfs_mount.c:1314 > #11 0xffffffff8054ff8b in sys_unmount (td=3D0xfffffe00bd683480, > uap=3D0xffffff90d2c87a40) at > /usr/home/flo/dev/checkouts/svn-src/sys/kern/vfs_mount.c:1211 > #12 0xffffffff806b4845 in amd64_syscall (td=3D0xfffffe00bd683480, > traced=3D0) at subr_syscall.c:134 > #13 0xffffffff8069d04b in Xfast_syscall () at exception.S:387 > #14 0x0000000800882ffa in ?? () > Previous frame inner to this frame (corrupt stack?) >=20 I was able to reproduce it locally. I think that you need to have a file opened for write on the nullfs mount, and then do forced unmount of the mount, while file is still open. The patch below fixed it for me. diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index cc35d81..3be7366 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -740,6 +740,13 @@ null_reclaim(struct vop_reclaim_args *ap) vp->v_object =3D NULL; vp->v_vnlock =3D &vp->v_lock; VI_UNLOCK(vp); + + /* + * If we were opened for write, we borrowed one write + * reference to the lower vnode. Undo the reference now. + */ + if (vp->v_writecount > 0) + VOP_ADD_WRITECOUNT(lowervp, -1); vput(lowervp); free(xp, M_NULLFSNODE); =20 --Ublo+h3cBgJ33ahC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7f/WAAoJEJDCuSvBvK1BFgAP/23/mb2Zgdn1dJwgwGSY6e2E UN2Gsw4mclgJgciSBzWwD/RbNKAu0NrlUTc76TMPqbfM4tp7QCKL7keH+m1u48e3 h2kQhmkazWskWy9rtNp796LOB3dESEkipLy4cQctkNDFlx/QjoDNP8CcZagpctjZ wGrQVLsoOwOuLF45XmoG31XULer93pZaQFQke71af3gW6yGSkOpQzzQMtlwxIHXJ boPHQCQBnKGBbc9d0kRX8uFjW3dwxONkaN179bMSFlIw2NBs0c11WvtWLUiQQFBU +PSC+Sh/tSusDj9oBz4jD5Kftx0z3WJVWOUcx2ZPzlAAPHaJAkr99ggEnpea94XD RUEL45oG+y0V8TzITpWaM4ybwzXl8B9DQYCa5U8PIzl1OlqhDecjFgyKQY0y9k22 r1eCw65LHjebt7dk9jAcGK7AP/DTDYsSIU1xqw+NyM8kzOGaxNWjSEIE5vl3EOon XLuVDo8eak5gqkfoTMdTxgQ2clcMUGBuDar0Pfnz2EIXMTjCM3sz2xKXGFfonauP zOU88l5g5mQ84GWjcwaYtvuWl5ukhMNlnyVWN1QOWNfZBmJUaz1SHkoRnEclP9sY /p7CfQLwT965UkbN859aB6OuV6TvRgZjQJWNScymZcjySUd22rVUo/qz2oY5B+39 iruVs8zGvZ99xS+YK2Ow =xe7n -----END PGP SIGNATURE----- --Ublo+h3cBgJ33ahC--