Re: [PATCH 0/3] Fixes for vfs-scale and vfs-automount

From: Al Viro
Date: Thu Feb 24 2011 - 10:00:01 EST


On Thu, Feb 24, 2011 at 06:07:33PM +0800, Ian Kent wrote:
> > I really don't like the look of autofs4_tree_busy(), BTW - you don't need
> > RCU to get races here; just a plain chdir("../../.."); done by a process
> > that sits deep enough in subtree you are checking can very well race with
> > your check, so that your iterator gets through the new cwd before chdir()
> > and through the old one after it...
>
> Yes, that's a problem.
>
> Previously the dcache_lock would have blocked on the dput() ... mmm, I'd
> missed that so far, although Nick didn't talk with me about his changes
> very much at all and I didn't pay enough attention to his patch series
> along the way, oops!

Well... In principle, you could mark all mountpoints in a tree as managed,
have an "expiry search in progress" flag to stop everything in there while
the expiry happens, then wait out all RCU walks in progress, then go ahead
with your expiry checks. Would that work for you?
--
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/