lkml.org 
[lkml]   [1999]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: dir hardlinks (was: Re: fsync on large files)
Date
From
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/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.032 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site