Re: VFS locking & HFS problems (2.4.6pre6)

From: Benjamin Herrenschmidt (benh@kernel.crashing.org)
Date: Fri Jun 29 2001 - 11:10:52 EST


Alan Cox wrote:

>Holding a spinlock while sleeping is an offence punishable by deadlock..

Right, and it's indeed the problem. But I'm still concerned about
locking since by using that spinlock, the guy who wrote it did
not expect beeing re-entered at this point, and just "cleaning" it
may not be enough.

>You might also look for memory allocations that are not GFP_ATOMIC made with
>the lock held

Yup. It's the problem. It locks, then calls some alloc routines, which
fills a cache and uses kmalloc with GFP_KERNEL.

Turning it into GFP_ATOMIC might not be the best idea as the HFS
filesystem currently shares a single hfs_malloc() for everybody and
turning it into GFP_ATOMIC would cause all of HFS allocs to be atomic.

I can change this single routine (and any other doing the same thing),
but I'd rather fix it by making sure HFS can safely sleep at this
point and still use GFP_KERNEL.

I just found Documentations/filesystems/Locking document, I bet I'll
find all the infos I need there. It's amazing how long it took me
to look for the info where it logically should be ;)

Ben.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 30 2001 - 21:00:22 EST