Re: [PATCH] First casuality of hlist poisoning in 2.5.70

Linus Torvalds (torvalds@transmeta.com)
Wed, 11 Jun 2003 17:32:16 -0700 (PDT)


On Wed, 11 Jun 2003, Trond Myklebust wrote:
>
> AFAICS one should not rehash the dentry until after the d_move(). Does
> that make sense?

Yeah, it does seem that rehashing before actually calling d_move() means
that there is a small window where another process might now come in, and
use the dcache (without getting the semaphore) to see the old value of the
target dentry, even though the low-level filesystem has already move the
new dentry value over the target. Ie the window would be between

i_op->rename(...)
d_rehash(new_dentry)
... race here ...
d_move(old_dentry, new_dentry)

That might confuse a filesystem that expected that the target was deleted
an no longer reachable by anybody.

Al? What do you think?

Linus

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