On Thu, 28 Sep 2000, Marko Kreen wrote:

> root@snoopy:~# debugfs
> debugfs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
> debugfs:  open /dev/sda6
> debugfs:  stat lib/postgres/data/base
> Inode: 14479   Type: directory    Mode:  0700   Flags: 0x0   Generation: 883245
> User:    31   Group:    32   Size: 1024

Ugh. With such size it should have 1 chunk, so there should be no way it
could get ext2_check_dir_entry() called at offset 1024. Weird.

Could you replace 
        if (!ext2_check_dir_entry("ext2_add_entry", dir,de, page))
                goto out_page;
with
        if (!....) {
        printk(KERN_ERROR "ext2_add_link: %d %d %d %d %d %d\n",
                chunk_offs,de-(char*)page_address(page),(int)n,chunk_size,
                chunk-(char*)page_address(page), (int)dir->i_size);
                goto out_page;
        }
and see what will it do?

Look: ->i_size == 1024 => dir_chunks() == (1024+1023)>>10, i.e. 1. That
is, loop in ext2_add_link is
        for (n=0; n<1; n++) {
                ...
        }
There is only one place in ext2_add_link() that calls ext2_check_dir_entry()
You managed to get offs == 1024. It means de == page_address(page)+1024.
IOW, either de >= chunk+chunk_size and we shouldn't get into that point
in the while() {}, or chunk > page_address(page) or chunk_size > 1024.
ext2_dir_chunk(...,0,p) _must_ return page_address(*p), no matter what. 
And chunk_size is a ->i_sb->s_blocksize - it would better be equal to
1024, or many things would break badly. Weird...

I have a next version of the patch, but I would really like to understand
what happens here...

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to