Re: ext2 readdir/lookup/check_page behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 14, 2006  09:25 -0600, Eric Sandeen wrote:
> has an image with a corrupt directory inode - despite having only 4 blocks, 
> it has an extremely large i_size.
> 
> It seems odd to me that readdir bails out with an error on the first bad 
> page, while lookup keeps trying.  Shouldn't these be consistent?  And if 
> so, which is the desired behavior?

I'd prefer that readdir _should_ return all of the valid directory blocks
it can find.  Otherwise, it makes on average 1/2 of the files in that dir
inaccessible.

> Or, perhaps a check high up that says if i_size doesn't correlate to 
> i_blocks, this inode is corrupt, and bail out early.

We did that for ext3, no?  It would make sense to fix ext2 in the same way.
I'd suggest bailing out "early" == min(i_size >> blocksize, i_blocks).
The i_blocks count is an upper limit, because it includes the overhead of
indirect blocks.  Directories cannot be sparse.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux