Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Jeremy Fitzhardinge
On Sat, Apr 21, 2001 at 02:21:38AM -0400, Alexander Viro wrote: > Looks sane for me. However, I would add check for dentry being hashed and > would skip the unhashed ones. Otherwise you can get a directory that > had been removed but is still busy - doesn't look like a right thing to > do. Jeremy?

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Jeremy Fitzhardinge
On Fri, Apr 20, 2001 at 10:59:43PM -0700, Linus Torvalds wrote: > It's untested, but looks fairly obvious. It removes the increment, and > changes autofs4_expire() to properly bump the count of the returned dentry > (and callers will dput() it when done). This may be unnecessarily careful, > but i

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Alexander Viro
On Fri, 20 Apr 2001, Linus Torvalds wrote: > > > On Fri, 20 Apr 2001, Jeremy Fitzhardinge wrote: > > > > I kept the dget/put out caution and ignorance, but they're clearly > > problematic. I'm happy to drop them if holding dcache_lock is enough > > to keep the tree stable while I traverse it

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Linus Torvalds
On Fri, 20 Apr 2001, Jeremy Fitzhardinge wrote: > > I kept the dget/put out caution and ignorance, but they're clearly > problematic. I'm happy to drop them if holding dcache_lock is enough > to keep the tree stable while I traverse it. How does this patch look to you people? It's untested, b

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Jeremy Fitzhardinge
On Fri, Apr 20, 2001 at 03:53:45PM -0400, Alexander Viro wrote: > > Why are we doing the mntget/dget at all? We hold the spinlock, so we know > > they are not going away. Not doing the mntget/dget means that we (a) run > > faster and (b) don't have the bug, because we don't need to put the damn >

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Alexander Viro
On Fri, 20 Apr 2001, Linus Torvalds wrote: > Why are we doing the mntget/dget at all? We hold the spinlock, so we know > they are not going away. Not doing the mntget/dget means that we (a) run > faster and (b) don't have the bug, because we don't need to put the damn > things. > > Comments?

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Linus Torvalds
On Fri, 20 Apr 2001, Jeremy Fitzhardinge wrote: > > This is a fix for a potential deadlock in autofs4's expire routine. It's wrong. I don't think we should be able to do a mntput() _either_ inside the spinlock. The filesystem should not "know" that mntput is safe. For this reason I don't thin

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Jeremy Fitzhardinge
On Fri, Apr 20, 2001 at 05:00:04AM -0400, Alexander Viro wrote: > Frankly, I'd rather add dput_locked() in dcache.c. The bug is real and > since autofs4 is not the only place like that... I'll look into that > stuff. Sounds fine. J - To unsubscribe from this list: send the line "unsubscr

Re: Fix for SMP deadlock in autofs4

2001-04-20 Thread Alexander Viro
On Fri, 20 Apr 2001, Jeremy Fitzhardinge wrote: > This is a fix for a potential deadlock in autofs4's expire routine. > It tries to use dput() while holding the dcache_lock. This isn't a > problem in principle since dput() should only try to take the dcache_lock > when the counter makes a tran