Messages in this thread | | | Subject | Re: dir hardlinks (was: Re: fsync on large files) | Date | Fri, 26 Feb 1999 18:37:09 +0100 | From | Ulrich Schmid <> |
| |
On 24 Feb 1999, Alexander Viro wrote:
> Moreover, it makes innocent, normal rename O(number of children) + > O(number of children) operation instead of O(1) + O(depth) (IO + RAM > accesses, that is).
Maybe it's possible to handle the "innocent, normal" case with almost no overhead, independent from the final algorithm to prevent directory cycles. Even if hard-linking directories are possible, the "innocent, normal" user will unlikely mess with hard-linking directories. So the typical situation will be, that the sysadmin occasionally does some magic with it (like linking /usr/X11 and /usr/X11R6), but most user trees will not contain any multi-parented directory.
The directories could be classified following:
Simple: - The directory has a single parent - All subdirectories are simple Semi-simple: - The directory has multiple parents - All subdirectories are simple Hairy: - At least one subdirectory is hairy or semi-simple
To maintain this state, each directory should maintain a counter of hairy/semi-simple subdirectories.
The advantage of this is, that an operation on a simple/semi-simple directory needs only to check/modify the simple ancestors plus the first hairy/semi-simple ancestor. These ancestors are already in the dcache, as they are required to reach the directory/target_directory.
So the critical code need only deal with the hairy directories.
But still the hairy case is ... hairy.
As I am not a fs expert, I don't know which kinds of DoS attacks could occur. So I would like to ask, if an O(number of ancestors) solution could be acceptable if - Only one ancestor is locked at a time - All locks are released after each processed ancestor
If such a solution would be acceptable, maybe I have an idea.
Ulrich Schmid
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |