From owner-freebsd-current@FreeBSD.ORG Sat Sep 12 15:32:41 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 456D5106568B; Sat, 12 Sep 2009 15:32:41 +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 79E0E8FC0C; Sat, 12 Sep 2009 15:32:39 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C017345E49; Sat, 12 Sep 2009 17:32:37 +0200 (CEST) Received: from localhost (abgy240.neoplus.adsl.tpnet.pl [83.7.88.240]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 14DB245C9F; Sat, 12 Sep 2009 17:32:30 +0200 (CEST) Date: Sat, 12 Sep 2009 17:32:30 +0200 From: Pawel Jakub Dawidek To: Jaakko Heinonen Message-ID: <20090912153230.GA5522@garage.freebsd.pl> References: <4AA40E30.50109@FreeBSD.org> <4AAA9187.2020907@FreeBSD.org> <20090911210053.GA2090@garage.freebsd.pl> <20090912090353.GA806@a91-153-125-115.elisa-laajakaista.fi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <20090912090353.GA806@a91-153-125-115.elisa-laajakaista.fi> 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: Kris Kennaway , FreeBSD Current , Kip Macy Subject: Re: panic: sx_xlock() of destroyed sx @ /zoo/kris/src8/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/co mmon/fs/zfs/zfs_rlock.c:535 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: Sat, 12 Sep 2009 15:32:41 -0000 --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 12, 2009 at 12:03:53PM +0300, Jaakko Heinonen wrote: > On 2009-09-11, Pawel Jakub Dawidek wrote: > > > >panic: sx_xlock() of destroyed sx @=20 > > > >/zoo/kris/src8/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/co= mmon/fs/zfs/zfs_rlock.c:535=20 > >=20 > > I was trying to reproduce it by doing much more frequent syncs and > > lowering vnodes limit, so they are inactivated more often, but I wasn't > > able to reproduce it. > >=20 > > The problem here is that we lock a range for the given znode, but before > > we unlock the range, znode is destroyed. >=20 > I wonder if this could be related to PR kern/132068 (i.e. zfs_zget() can > return reclaimed vnodes). >=20 > If you can reproduce the panic you could try this patch: >=20 > http://www.saunalahti.fi/~jh3/patches/zfs_zget-vnode-reclaim-race.diff Good catch. I modifed the kernel to reclaim all vnodes on every getnewvnode() and also slowed down zfs_reclaim_complete() and I was able to reproduce this race. I also found another problem - when we defer znode destruction there is a race where file system unmount or rollback can be called between zfs_freebsd_reclaim() and zfs_reclaim_complete(), which can case various problems. I almost have a patch ready, but it needs some more work. I'll post it ASAP. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKq78OForvXbEpPzQRAvwQAKCk4+jKFEmHIyjstvCeRvGrnkybAQCfTs+o RG/GjAuDr9gMnGlwZQJ6G10= =DogF -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--