Re: [BK PATCH] Add ext3 indexed directory (htree) support

Ryan Cumming
2002-09-28T01:15:33Z

[-- Attachment #1: clearsigned data --]
[-- Type: Text/Plain, Size: 879 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On September 26, 2002 21:12, Andreas Dilger wrote:
> After that, we'd be happy if you could test with a loopback filesystem:

Okay, got another one:
"EXT3-fs error (device loop(7,0)): ext3_add_entry: bad entry in directory #2:
rec_len is smaller than minimal - offset=0, inode=0, rec_len=8, name_len=0"
fsck then reported:
"Directory inode 2, block 166, offset 0: directory corrupted"

This is while deleteing an old fsstress directory (a full fsck had been
performed since the last time the fsstress directory had been touched) while
running a few instances of the attached program.

You guys have any idea what's going on yet?

- -Ryan

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE9lQPpLGMzRzbJfbQRAlzdAJ9mbiu8lRBbcFZXE/tD94Ad9DoAowCdFzab
JkelXV/8C4fsqEqg9TfBvb0=
=VA58
-----END PGP SIGNATURE-----

[-- Attachment #2: dir-ream.c --]
[-- Type: text/x-csrc, Size: 982 bytes --]

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <time.h>

#define MAX_FILE_COUNT 4000000

int main(int argc, char *argv[])
{
while(1)
{
unsigned int seed;
struct timeval tv;
int i;
int count;

gettimeofday(&tv, NULL);
seed = tv.tv_usec;
count = seed % MAX_FILE_COUNT;

srand(seed);
printf("Creating %i files\n" , count);
for(i = 0; i < count;i++)
{
char filename[32];
snprintf(filename, 32, "%x", rand());
close(open(filename, O_CREAT | O_RDONLY));
}

printf("Performing %i random lookups\n" , count);
for(i = 0; i < count;i++)
{
char filename[32];
struct stat useless;

snprintf(filename, 32, "%x", rand());
stat(filename, &useless);
}

srand(seed);
printf("Unlinking %i files\n" , count);
for(i = 0; i < count;i++)
{
char filename[32];
snprintf(filename, 32, "%x", rand());
unlink(filename);
}
}
}