cache_lookup() work this week.

Matthew Dillon dillon at apollo.backplane.com
Fri Sep 5 10:10:37 PDT 2003


:>
:>     This is a good one, and easy to solve... rm would just unlink() or
:>     rmdir() the directory first, whether it is empty or not.  If the unlink
:>     succeeds then rm considers its work done.
:>
:>     The last instance of the directory would not be unlinkable... rm -rf
:>     would have to recurse through and delete the underlying files first.
:
:
:mkdir -p /a/b/c/d/e
:ln /a/b/c /a/b/c/d/e/f
:rm -r /a/b
:
:...leaves an unreachable cycle.
:
:There are advantages in having a DAG for directory trees. I'm still
:trying to figure out what good permitting cycles does.
:
:
:-- 
:jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/

    Yup.  The issue with preventing cycles... and I think it is a good
    idea to prevent cycles... but the issue is that while you can prevent
    a cycle from occuring at the time you create the hard link, how do you
    prevent a cycle from occuring due to a later rename of some parent directory?
    Short of scanning the entire subhiearchy when renaming I see no way to 
    detect the cycle.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list