Re: [PATCH] VFAT fixes.

Linus Torvalds (torvalds@transmeta.com)
Thu, 14 Jan 1999 23:20:53 -0800 (PST)


On Fri, 15 Jan 1999, Alexander Viro wrote:
>
> Nope. Sorry, I should have explain it better. If we are renaming
> over the directory we should unhash the target at least for the time
> between the beginning of emptiness check and the moment when we
> cannibalize the target. Otherwise we are open for races (somebody could
> grab the target and make it non-empty).

I'd agree about the unhashing, but as you have to re-hash it anyway if the
emptiness check fails, I'd argue for just doing something like

unhash()
empty = check_empty()
rehash()
if (empty)
d_move()

and then we can leave d_move() with the very simple semantics it has (and
that make tons of sense for files etc).

I've put a pre-8 in "testing" on ftp.kernel.org if you'd care to look: it
does "lock_parent()" differently, and while I applied your vfat-specific
parts I didn't apply the other parts because they should be a non-issue
with pre-8 anyway (but you should verify your use of "d_move()", ok?)

Linus

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