Re: Linux 2.6.26-rc4

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Al Viro <viro@...>, Miklos Szeredi <miklos@...>, <jesper@...>, <linux-kernel@...>, <linux-fsdevel@...>
Date: Tuesday, June 3, 2008 - 1:13 pm

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


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.26-rc4, Linus Torvalds, (Mon May 26, 2:41 pm)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Wed Jun 4, 1:51 pm)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Tue Jun 3, 5:49 am)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 5:57 am)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 6:35 am)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Tue Jun 3, 6:04 am)
Re: Linux 2.6.26-rc4, Miklos Szeredi, (Tue Jun 3, 6:13 am)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 6:40 am)
Re: Linux 2.6.26-rc4, Miklos Szeredi, (Tue Jun 3, 6:45 am)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 6:52 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 9:27 am)
Re: Linux 2.6.26-rc4, Linus Torvalds, (Tue Jun 3, 11:01 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Thu Jun 5, 3:31 am)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Fri Jun 6, 2:23 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Fri Jun 6, 4:21 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Fri Jun 6, 4:25 am)
Re: Linux 2.6.26-rc4, Andrew Morton, (Thu Jun 5, 6:30 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Fri Jun 27, 12:18 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Thu Jun 5, 10:47 pm)
Re: Linux 2.6.26-rc4, Linus Torvalds, (Thu Jun 5, 5:29 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Thu Jun 5, 10:39 pm)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Thu Jun 5, 5:34 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 12:07 pm)
Re: Linux 2.6.26-rc4, Linus Torvalds, (Tue Jun 3, 12:35 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 1:13 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 1:30 pm)
Re: Linux 2.6.26-rc4, Jeff Moyer, (Tue Jun 3, 1:46 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 3:18 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 9:36 pm)
Re: Linux 2.6.26-rc4, Jeff Moyer, (Tue Jun 3, 3:53 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 7:00 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 10:42 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 10, 12:57 am)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Tue Jun 10, 2:28 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 10, 2:40 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Wed Jun 11, 11:03 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Thu Jun 12, 7:19 am)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Thu Jun 12, 3:02 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Thu Jun 12, 7:21 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 10, 5:09 am)
Re: Linux 2.6.26-rc4, Miklos Szeredi, (Wed Jun 4, 1:34 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Wed Jun 4, 1:41 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 1:38 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 12:41 pm)
Re: Linux 2.6.26-rc4, Linus Torvalds, (Tue Jun 3, 12:59 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 1:30 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 12:50 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 1:28 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 1:41 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 1:41 pm)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 1:50 pm)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 1:49 pm)
Re: Linux 2.6.26-rc4, Miklos Szeredi, (Tue Jun 3, 6:37 am)
Re: Linux 2.6.26-rc4, Al Viro, (Tue Jun 3, 6:48 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 9:31 am)
Re: Linux 2.6.26-rc4, Ian Kent, (Tue Jun 3, 9:32 am)
Re: Linux 2.6.26-rc4, J.A. , (Tue May 27, 6:01 am)
Re: Linux 2.6.26-rc4, Bill Davidsen, (Wed May 28, 7:59 pm)
2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Alexey Dobriyan, (Tue May 27, 1:23 am)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Oleg Nesterov, (Tue May 27, 5:06 am)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Linus Torvalds, (Tue May 27, 11:03 am)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Oleg Nesterov, (Tue May 27, 12:45 pm)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Oleg Nesterov, (Tue May 27, 1:37 pm)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Alexey Dobriyan, (Tue May 27, 5:26 pm)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Paul E. McKenney, (Tue May 27, 11:40 am)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Linus Torvalds, (Tue May 27, 12:11 pm)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Paul E. McKenney, (Tue May 27, 1:06 pm)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Paul E. McKenney, (Wed May 28, 1:01 am)
Re: 2.6.26-rc4: RIP find_pid_ns+0x6b/0xa0, Paul E. McKenney, (Wed May 28, 3:26 am)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Mon May 26, 5:24 pm)
Re: Linux 2.6.26-rc4, Linus Torvalds, (Mon May 26, 5:42 pm)
Re: Linux 2.6.26-rc4, Carl-Daniel Hailfinger, (Mon May 26, 9:16 pm)
Re: Linux 2.6.26-rc4, Jeff Garzik, (Tue May 27, 6:35 am)
Re: Linux 2.6.26-rc4, Carl-Daniel Hailfinger, (Tue May 27, 6:53 am)
Re: Linux 2.6.26-rc4, Jeff Garzik, (Tue May 27, 6:54 am)
Re: Linux 2.6.26-rc4, Carl-Daniel Hailfinger, (Tue May 27, 6:58 am)
Re: Linux 2.6.26-rc4, Carl-Daniel Hailfinger, (Mon May 26, 9:23 pm)
Re: Linux 2.6.26-rc4, Abhijit Menon-Sen, (Mon May 26, 9:52 pm)
Re: Linux 2.6.26-rc4, David Woodhouse, (Tue May 27, 1:31 am)
[MTD] [MAPS] ck804rom: fix driver_data in probe table., David Woodhouse, (Tue May 27, 1:31 am)
Re: Linux 2.6.26-rc4, Jesper Krogh, (Tue May 27, 1:19 am)
Re: Linux 2.6.26-rc4, Arjan van de Ven, (Mon May 26, 8:25 pm)
Re: Linux 2.6.26-rc4, David Woodhouse, (Tue May 27, 1:43 am)
Re: Linux 2.6.26-rc4, Arjan van de Ven, (Tue May 27, 2:00 am)
Re: Linux 2.6.26-rc4, David Woodhouse, (Tue May 27, 2:24 am)
Re: Linux 2.6.26-rc4, Arjan van de Ven, (Mon May 26, 8:31 pm)