On Tue, 2008-06-03 at 09:35 -0700, Linus Torvalds wrote:In the current code the only way a dentry gets onto this list is by one of the two operations ->unlink() or ->rmdir(), it is d_drop'ed and left positive by both of these operations (a carry over from 2.4 when d_lookup() returned unhashed dentrys, I missed that detail for quite a while). It's been a while now but the original patch description should help. "What happens is that during an expire the situation can arise that a directory is removed and another lookup is done before the expire issues a completion status to the kernel module. In this case, since the the lookup gets a new dentry, it doesn't know that there is an expire in progress and when it posts its mount request, matches the existing expire request and waits for its completion. ENOENT is then returned to user space from lookup (as the dentry passed in is now unhashed) without having performed the mount request. The solution used here is to keep track of dentrys in this unhashed state and reuse them, if possible, in order to preserve the flags. Additionally, this infrastructure will provide the framework for the reintroduction of caching of mount fails removed earlier in development." I wasn't able to do an acceptable re-implementation of the negative caching we had in 2.4 with this framework, so just ignore the last sentence in the above description. It has been previously hashed, yes. Unfortunately no, but I thought that once the dentry became unhashed (aka ->rmdir() or ->unlink()) it was invisible to the dcache. But, of course there may be descriptors open on the dentry, which I think is the problem that's being pointed out. Yes, that would be ideal but the reason we arrived here is that, because we must release the directory mutex before calling back to the daemon (the heart of the problem, actually having to drop the mutex) to perform the mount, we can get a deadlock. The cause of the problem was that for "create" like operations the mutex is held for ->lookup() and ->revalidate() but for a "path walks" the mutex is only held for ->lookup(), so if the mutex is held when we're in ->revalidate(), we could never be sure that we where the code path that acquired it. Sorry, this last bit is unclear. I'll need to work a bit harder on the explanation if you're interested in checking further. Anyway, I'm sure I made the dentry negative upon getting a rehash hit for a reason so I'll need to revisit it. Perhaps I was misguided in the first place or perhaps just plain lazy. Ian --
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Willy Tarreau | Re: Linux 2.6.21 |
| Jan Kundrát | kswapd high CPU usage with no swap |
git: | |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] tcp: splice as many packets as possible at once |
