DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cache_lookup() work this week.


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 5 Sep 2003 10:09:53 -0700 (PDT)

:>
:>     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@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]