Re: Linux 2.6.26-rc4

From: Linus Torvalds
Date: Tue Jun 03 2008 - 12:36:22 EST




On Wed, 4 Jun 2008, Ian Kent wrote:
>
> The code we're talking about deals with a race between expiring and
> mounting an autofs mount point at the same time.
>
> I'll have a closer look and see if I can make it work without turning
> the dentry negative.

Hmm.

Can you walk me through this?

If the dentry is unhashed, it means that it _either_

- has already been deleted (rmdir'ed) or d_invalidate()'d. Right?

I don't see why you should ever return the dentry in this case..

- or it has not yet been hashed at all

But then d_inode should be NULL too, no?

Anyway, as far as I can tell, you should handle the race between expiring
and re-mounting not by unhashing at expire time (which causes these kinds
of problems), but by setting a bit in the dentry and using the dentry
"revalidate()" callback to wait for the revalidate.

But I don't know autofs4, so you probably have some reason. Could you
explain it?

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