From owner-freebsd-fs@FreeBSD.ORG Wed Mar 18 13:10:03 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08717106564A; Wed, 18 Mar 2009 13:10:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 98F368FC0C; Wed, 18 Mar 2009 13:10:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LjvWx-000GV8-TI; Wed, 18 Mar 2009 15:10:00 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n2ID9k2b095637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 18 Mar 2009 15:09:47 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n2ID9kra005541; Wed, 18 Mar 2009 15:09:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n2ID9k6e005540; Wed, 18 Mar 2009 15:09:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 18 Mar 2009 15:09:46 +0200 From: Kostik Belousov To: Attilio Rao Message-ID: <20090318130946.GD41617@deviant.kiev.zoral.com.ua> References: <200903140450.n2E4o3to011990@freefall.freebsd.org> <20090314102135.GA93077@x2.osted.lan> <20090314203215.GA41617@deviant.kiev.zoral.com.ua> <3bbf2fe10903180159x10d2c721rf9ff4147a5c75ec7@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CqcVIibhaBEAt2VI" Content-Disposition: inline In-Reply-To: <3bbf2fe10903180159x10d2c721rf9ff4147a5c75ec7@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LjvWx-000GV8-TI 501d19269db1232c3dacc32d39e2d138 X-Terabit: YES Cc: Yoshihiro Ota , Peter Holm , freebsd-fs@freebsd.org Subject: Re: kern/132597: [tmpfs] [panic] tmpfs-related panic while interrupting a port build on tmpfs WRKDIR X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2009 13:10:03 -0000 --CqcVIibhaBEAt2VI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 18, 2009 at 09:59:14AM +0100, Attilio Rao wrote: > 2009/3/14, Kostik Belousov : > > On Sat, Mar 14, 2009 at 11:21:35AM +0100, Peter Holm wrote: > > > On Sat, Mar 14, 2009 at 04:50:03AM +0000, Yoshihiro Ota wrote: > > > > The following reply was made to PR kern/132597; it has been noted = by GNATS. > > > > > > > > From: Yoshihiro Ota > > > > To: bug-followup@FreeBSD.org > > > > Cc: bf2006a@yahoo.com > > > > Subject: Re: kern/132597: [tmpfs] [panic] tmpfs-related panic while > > > > interrupting a port build on tmpfs WRKDIR > > > > Date: Sat, 14 Mar 2009 00:42:58 -0400 > > > > > > > > Which ports were you compiling when panic happened? > > > > > > > > Hiro > > > > > > The panic in this PR looks a lot like the one I reported to attilio@ > > > > > > http://people.freebsd.org/~pho/stress/log/attilio022.txt > > > > > > It was just regular FS load that provoked it. > > > > > > It seems to be quite clean what is going on there. In fact, there are > > two issues: > > > > First is the usual problem of DOTDOT lookup that shall be fixed in sty= le > > of vn_vget_ino() by busying mp before unlocking dvp. > > > > Second one is the reason for the panic. The tmpfs vnode is unlocked, a= nd > > then corresponding tmpfs _node_ is passed to the tmpfs_alloc_vp(). > > Since the vnode may be reclaimed after the unlock, passed node might > > become freed. Then, the tmpfs_alloc_vp() would operate on the freed > > memory. >=20 > So I have a question. > In the tmpfs_lookup() there is dvp with gets vhold() before to unlock > the dvp vnode lock. > That should not be enough to prevent recycling and freeing of the structu= re? No. The only thing that prevents vnode reclaim is the vnode lock. Both vhold and vref only prevent struct vnode * pointer from becoming invalid, i.e. freeing vnode memory, and also keep vnode interlock and lock functional. The difference between vhold and vref is that vref() prevents non-forced unmounts from reclaiming such vnode. --CqcVIibhaBEAt2VI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAknA8nsACgkQC3+MBN1Mb4i7sQCcCBDjBw8royQdW2SghABIGxtF p5sAoIlw+wfCLbMBBleyv/TOAABGwrkL =gLse -----END PGP SIGNATURE----- --CqcVIibhaBEAt2VI--