Re: patch for 2.1.51 d_umount

Linus Torvalds (torvalds@transmeta.com)
Tue, 19 Aug 1997 10:51:25 -0700 (PDT)


On Tue, 19 Aug 1997, Bill Hawes wrote:
>
> I posted this earlier to fix a problem in unmounting an initrd, but it
> must have fallen through the cracks. If an initrd isn't being remounted
> after changing roots, it gets unmounted. But as the root inode hasn't
> been mounted on anything, it gets one too many dputs.
>
> (I've also changed the name "covers" to "covered", as it always confuses
> me. A root is mounted "on top of" a directory, therefore the directory
> is "covered". Unless there's some other way of thinking about it ...)

I don't like the patch - instead of having testing for the special case in
a generic routine, I'd much have some special code in the special case.

(That's a basic tenet of mine. I have hundreds of these gems. Essentially
I hate special cases that impact generic routines - but a special case
that can hide itself so well that it works _with_ the generic routine is
fine).

In this case, I don't see why initrd couldn't just increment the count on
its own root inode, so that doing two dput()'s would be fine.. That way
the normal code would stay normal.

Linus