[OpenAFS-devel] Linux 2.6.12 kernel BUG at fs/namei.c:1189
chas williams - CONTRACTOR
chas@cmf.nrl.navy.mil
Mon, 30 Jan 2006 11:05:44 -0500
In message <43DDDCA2.9020305@pclella.cern.ch>,Rainer Toebbicke writes:
>The fact that in Linux inodes are somehow grafted on dentries doesn't
>make things easy of course - e.g. when it comes to running the cache
i wouldn't call it grafted. i see it was the functionality being
split across two layers, the inode layer and dentry layer. inodes
are just containers for the filesystem objects. dentries hold the
name to container mappings. to use an inode though you need a
dentry that points to it. an inode without a dentry is essentially
inactive.
>in put_inode (or after your patch in dentry_iput) you need to clean
>up, i.e. call afs_InactiveVCache(). For that you need the global lock
>- which you cannot always obtain e.g. if you hold it already.
which tells me that the code is probably doing something wrong.
>"less often" is not enough - you'd have to guarantee that you you
>never run into it already holding the lock. Or somebody waiting for
>"you" holding the lock which can happen in the kmalloc() chain - then
>"you" that's "kswapd". I doubt that by moving the call from inode
>cleanup to dentry cleanup avoids the scenario altogether.
kmalloc() should be running under GFP_NOFS which should keep the
the filesystem from deadlocking on AFS_GLOCK. however, for large
allocations, we fall over to vmalloc() which doesnt have the same
guarantee. typically vmalloc() only happens at init/startup time.
this probably needs fixed eventually.
i now believe its probably not wise to share a global lock (with the
exception of the BKL) between the inode and the dentry layers. i also
believe the dentry layer already protects itself against deadlocking
with prune_dcache() already.