Re: FS: hardlinks on directories

From: Stephan von Krawczynski (skraw@ithnet.com)
Date: Tue Aug 05 2003 - 08:03:51 EST


On Tue, 05 Aug 2003 14:51:46 +0200
Helge Hafting <helgehaf@aitel.hist.no> wrote:

> Even more fun is when you have a directory loop like this:
>
> mkdir A
> cd A
> mkdir B
> cd B
> make hard link C back to A
>
> cd ../..
> rmdir A
>
> You now removed A from your home directory, but the
> directory itself did not disappear because it had
> another hard link from C in B.

How about a truly simple idea:

rmdir A says "directory in use" and is rejected

Which means you simply cannot remove the first directory entry before not all
other links to it are removed. This implies only two things:
1) you have to know who was first.
2) you have to be able to find out where the links are.

Both sound solvable.

Regards,
Stephan

-
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/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:28 EST