From owner-freebsd-current@FreeBSD.ORG Wed May 16 15:58:11 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3328106566B for ; Wed, 16 May 2012 15:58:11 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) by mx1.freebsd.org (Postfix) with SMTP id 506048FC0C for ; Wed, 16 May 2012 15:58:11 +0000 (UTC) Received: from [98.139.212.148] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 16 May 2012 15:58:10 -0000 Received: from [98.139.211.193] by tm5.bullet.mail.bf1.yahoo.com with NNFMP; 16 May 2012 15:58:10 -0000 Received: from [127.0.0.1] by smtp202.mail.bf1.yahoo.com with NNFMP; 16 May 2012 15:58:10 -0000 X-Yahoo-Newman-Id: 660404.64989.bm@smtp202.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ciDVJg0VM1lA.azkQ6qziMtvDYMnOBw66.rWkNKf2io2LE9 _MGCd.t_b2RRaQX3_CvstRCr.xe0kRcGEBB2BKX8cyTZDOajTIf4hB1Tlq3z bQx1fw2sQ_kJfzuLGn9lcHPJJgQT8A_Q9hfjrbrRDgDbMoVsWayP.aRcSp5q 5EZKfxf4JANCyrO676q8roUOcVjNpsWF7auLydaNuRt9ukfWy7RmLmqll._I XGj3ye5Y9haehU4kqXtr1YgtPKeIHsZtk9nYGD_pKImm232H2mb56hsk.G2M LQETLlybxdg6nkrlGJRMs82KOHWBWk3m0t8ergQ09GaA4l6u8Eg0rddkP5KW eOdD9Pch2GP6c4Ns_thrxXZKYUkio8fWatZO19iaXpzpaOFa43BhHY2Nijh. p5vTlsDlFfRnaGh_OE.i.2Pxfq2nV852pKBPJ8sHI9o8LnZ7E63w.KMD77_4 lYIf2bddaUjeXH59_eEqEYN_iQ5zRXGWC1WPYw0GLtczkXmsB9zsR34qzP.J BR5GAa9Eu9uCftmS5oxMEJlhzGpBF2KFZoM6deo8Qroyue9Vh.rWesmcWPbS dBJburGL1XuC4Jbbab05yizSCBMd7CmnTkiS8eJnttqLGeEoDpj4S5b7iyIV ZyK0E75S.Rxpg2pmkg1K7HM4- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Received: from [192.168.10.103] (pfg@200.118.157.7 with plain) by smtp202.mail.bf1.yahoo.com with SMTP; 16 May 2012 08:58:10 -0700 PDT Message-ID: <4FB3CE90.8050004@FreeBSD.org> Date: Wed, 16 May 2012 10:58:08 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.3) Gecko/20120328 Thunderbird/10.0.3 MIME-Version: 1.0 To: Mateusz Guzik , freebsd-current@FreeBSD.org References: <4FA6F324.4080107@FreeBSD.org> <4FA82269.6080406@FreeBSD.org> <20120507201153.GA19942@dft-labs.eu> <20120508194514.GA10688@x2.osted.lan> <20120510102118.GA26472@dft-labs.eu> <20120510103900.GA77554@x2.osted.lan> <20120512224938.GA1322@dft-labs.eu> In-Reply-To: <20120512224938.GA1322@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: panic, seems related to r234386 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, 16 May 2012 15:58:11 -0000 Hello; On 05/12/12 17:49, Mateusz Guzik wrote: >>>> >>>> Gave this a spin and found what looks like a deadlock: >>>> >>>> http://people.freebsd.org/~pho/stress/log/ext2fs.txt >>>> >>>> Not a new problem, it would seem. Same issue with 8.3-PRERELEASE r232656M. >>>> >>> pid 2680 (fts) holds lock for vnode cb4be414 and tries to lock cc0ac15c >>> pid 2581 (openat) holds lock for vnode cc0ac15c and tries to lock cb4be414 >>> >>> openat calls rmdir foo/bar and ext2_rmdir unlocks and tries to lock >>> again foo's vnode. >>> >>> This is fairly easly reproducible with concurrently running mkdir and fts >>> testcase programs that are provided by stress2. >>> >>> I'll try to come up with a patch by the end of the week. >>> > Easier way to reproduce: mkdir from stress2 and "while true; do find /mnt> > /dev/null; done" on another terminal. > > Assuming foo/bar directory tree, deadlock happens during removal of bar > with simultaneous lookup of .. in bar. > > Proposed trivial patch: > http://student.agh.edu.pl/~mjguzik/patches/ext2fs_rmdir-deadlock.patch > > If the lock cannot be acquired immediately unlocks 'bar' vnode and then > locks both vnodes in order. > > After patching this I ran into another issue - wrong vnode type panics > from cache_enter_time after calls by ext2_lookup. (It takes some time to > reproduce this, testcase as before.) > > It looks like ext2_lookup is actually adapted version of ufs_lookup and > lacks some bugfixes present in current ufs_lookup. I believe those > bugfixes address this bug. > > Here is my attempt to fix the problem (based on ufs_lookup changes): > http://student.agh.edu.pl/~mjguzik/patches/ext2fs_lookup-relookup.patch > It is indeed extremely useful that UFS and ext2fs are so similar. The two bugfixes were committed as revision 235508, thanks! Pedro.