From owner-freebsd-current@FreeBSD.ORG Wed Jul 29 21:17:47 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 057A4106566C; Wed, 29 Jul 2009 21:17:47 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA108FC1C; Wed, 29 Jul 2009 21:17:46 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 982C345C89; Wed, 29 Jul 2009 23:17:44 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3276E45684; Wed, 29 Jul 2009 23:17:39 +0200 (CEST) Date: Wed, 29 Jul 2009 23:18:03 +0200 From: Pawel Jakub Dawidek To: Thomas Backman Message-ID: <20090729211803.GA2130@garage.freebsd.pl> References: <52AA86CB-6C06-4370-BA73-CE19175467D0@exscape.org> <4A705299.8060504@icyb.net.ua> <4A7054E1.5060402@icyb.net.ua> <5918824D-A67C-43E6-8685-7B72A52B9CAE@exscape.org> <4A705E50.8070307@icyb.net.ua> <4A70728C.7020004@freebsd.org> <6D47A34B-0753-4CED-BF3D-C505B37748FC@exscape.org> <4A708455.5070304@freebsd.org> <16B40A2B-A1B5-4528-8721-6D352E7D5419@exscape.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <16B40A2B-A1B5-4528-8721-6D352E7D5419@exscape.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-fs@freebsd.org, FreeBSD current , Andriy Gapon Subject: Re: zfs: Fatal trap 12: page fault while in kernel mode X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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, 29 Jul 2009 21:17:47 -0000 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 29, 2009 at 10:15:06PM +0200, Thomas Backman wrote: > On Jul 29, 2009, at 19:18, Andriy Gapon wrote: >=20 > > > >Thanks a lot again! > > > >Could you please try the following change? > >In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, in =20 > >function > >zfs_inactive() insert the following line: > > vrecycle(vp, curthread); > >before the following line: > > zfs_znode_free(zp); > > > >This is in "if (zp->z_dbuf =3D=3D NULL)" branch. > > > >I hope that this should work in concert with the patch that Pawel =20 > >has posted. > > > >P.S. > >Also Pawel has told me that adding 'CFLAGS+=3D-DDEBUG=3D1' to sys/=20 > >modules/zfs/Makefile > >should enable additional debugging checks (ASSERTs) in ZFS code. > > > >--=20 > >Andriy Gapon > Better backtraces: >=20 > Without your vrecycle() addition, and with the -DDEBUG=3D1 one (note to = =20 > self: core.txt.32): >=20 > Unread portion of the kernel message buffer: > panic: solaris assert: ((zp)->z_vnode) =3D=3D ((void *)0), file: /usr/src= /=20 > sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/=20 > zfs_znode.c, line: 1043 Modify zfs_inactive() 'zp->z_dbuf =3D=3D NULL' case to look like this: if (zp->z_dbuf =3D=3D NULL) { /* * The fs has been unmounted, or we did a * suspend/resume and this file no longer exists. */ VI_LOCK(vp); vp->v_count =3D 0; /* count arrives as 1 */ vp->v_data =3D NULL; VI_UNLOCK(vp); rw_exit(&zfsvfs->z_teardown_inactive_lock); ZTOV(zp) =3D NULL; vrecycle(vp, curthread); zfs_znode_free(zp); return; } --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKcLyLForvXbEpPzQRAmHsAJ4gLjI2hH8yCsYy62NKANOywFmpbgCgotVG LG97BCENfOQuQ1Z72jkaMcQ= =orhi -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx--