Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2012 10:58:08 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        Mateusz Guzik <mjguzik@gmail.com>, freebsd-current@FreeBSD.org
Subject:   Re: panic, seems related to r234386
Message-ID:  <4FB3CE90.8050004@FreeBSD.org>
In-Reply-To: <20120512224938.GA1322@dft-labs.eu>
References:  <4FA6F324.4080107@FreeBSD.org> <CAE-mSOJBHPP4E_2Hme5nwf0fGfckyRBWeAe9=kodHMmS6eQy%2Bg@mail.gmail.com> <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>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FB3CE90.8050004>