Re: [PATCH] dcache corruption

Linus Torvalds (torvalds@transmeta.com)
Tue, 6 Jan 1998 12:09:21 -0800 (PST)


On Tue, 6 Jan 1998, Peter J. Braam wrote:
>
> I spotted the following code a while ago and I believe it's not safe:
>
> d_free(dentry);
> if (dentry == parent)
> return;
> (line 115). This is referencing freed memory -- since d_free frees
> everyting.

No, it's only referencing the _pointer_ - not anything the pointer points
to. It's essentially saying that if the parent dentry (which we looked up
earlier, before the free) is the same as the dentry we just free'd, we
should not continue downwards in the dentry tree.

Linus