On 2/29/2012 11:44 PM, Theodore Tso wrote: > You might try sorting the entries returned by readdir by inode number > before you stat them. This is a long-standing weakness in > ext3/ext4, and it has to do with how we added hashed tree indexes to > directories in (a) a backwards compatible way, that (b) was POSIX > compliant with respect to adding and removing directory entries > concurrently with reading all of the directory entries using > readdir. When I ran into this a while back, I cobbled together this python script to measure the correlation from name to inode, inode to first data block, and name to first data block for all of the small files in a large directory, and found that ext4 gives a very poor correlation due to that directory hashing. This is one of the reasons I prefer using dump instead of tar for backups, since it rips through my Maildir more than 10 times faster than tar, since it reads the files in inode order.