Re: [Bug 417] New: htree much slower than regular ext3

Alex Tomas
2003-03-09T07:05:02Z

>>>>> Daniel Phillips (DP) writes:

DP> On Fri 07 Mar 03 16:46, Alex Tomas wrote:
DP> The problem I see with your approach is that the traversal is no
DP> longer in hash order, so a leaf split in the middle of a
DP> directory traversal could result in a lot of duplicate dirents.
DP> I'm not sure there's a way around that.

1) As far as I understand, duplicates are possible even in classic ext2
w/o sortdir/index. See the diagram:

Process 1 Process 2

getdents(2) returns
dentry1 (file1 -> Inode1)
dentry2 (file2 -> Inode2)

context switch -->
unlink(file1), empty dentry1
creat(file3), Inode3, use dentry1
creat(file1), Inode1, use dentry3

context switch -->

getdents(2) returns
dentry3(file1 -> Inode1)

Am I right?

2) Why do not use hash order for traversal like ext3_dx_readdir() does?
Upon reading several dentries within some hash set readdir() sorts them
in inode order and returns to an user.

with best regards, Alex