Re: vfs_unlink() >=2.5.5-pre1 question

Mike Galbraith (
Sat, 30 Mar 2002 20:47:37 +0100 (CET)

On Sat, 30 Mar 2002, Alexander Viro wrote:

> On Sat, 30 Mar 2002, Mike Galbraith wrote:
> > On Sat, 30 Mar 2002, Mike Galbraith wrote:
> >
> > > Hi,
> > >
> > > d_delete() doesn't appear to ever create negative dentries when
> > > called via vfs_unlink() due to the extra reference on the dentry.
> > > In fact, a printk() in the d_delete() spot never ever triggers...
> >
> > Well shoot. I guess I've chased this about as far as I can, and
> > hope this thread wasn't a total waste. I found a better way to
> > get my rm -r to work as before fwiw. Rewinding the directory on
> > seek failure (yeah, could do in three lines, but not the point)
> > works, but is kinda b0rken. I think the only interesting thing
> > in the below is the FIXME :)) but I'll post it anyway.
> Your patch is broken. FWIW, there are several real issues:

I'm not in the least suprised. (Actually, I'm rather pleased with
that assesment;)

> a) d_delete() being called too early in vfs_unlink(). Not a big
> deal, it's easy to move outside of dget()/dput(). However, you _can't_

Ok, at least here I was onto something.

> expect unlink() to make dentry negative. It's always possible that it
> will be left positive and unhashed - that's what we have to do if file
> we are unlinking is opened.

This one I'll have to fiddle with (thanks!). I was just looking at
the behavior delta, missing any real understanding of the 'why'.

> b) rm -rf expecting offsets in directory to stay stable after
> unlink(). B0rken, complain to GNU folks. Sorry, I'm not touching that
> code - GNU fileutils source is too yucky.

That was my starting point. (I kinda agree, but it's better than anything
_I_ could write from scratch, so..)

> c) dcache_readdir() behaviour. There was an old patch that makes
> it slightly more forgiving; I'll dig it out.

I'd love to see it


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at