Re: [RFC 1/2] ext3: enlarge blocksize and fix rec_lenoverflow

Andreas Dilger <[email protected]>
Newsgroups gmane.comp.file-systems.ext2.devel,gmane.linux.kernel
Message-ID <[email protected]>
On Jun 29, 2006  19:46 +0900, Takashi Sato wrote:
> >On Jun 28, 2006  17:50 +0200, Johann Lombardi wrote:
> >>ext2/ext3_dir_entry_2 has a 16-bit entry(rec_len) and it would overflow
> >>with 64KB blocksize.  This patch prevent from overflow by limiting
> >>rec_len to 65532.
> >
> >Having a max rec_len of 65532 is rather unfortunate, since the dir
> >blocks always need to filled with dir entries.
> 
> Oh, that's right.
> 
> >65536 - 65532 = 4, and
> >the minimum ext3_dir_entry size is 8 bytes.  I would instead make this
> >maybe 64 bytes less so that there is room for a filename in the "tail"
> >dir_entry.
> 
> What does "64 bytes" mean?
> Do you mean that the following dummy entry should be added
> at the tail of the directory block?
> 
> struct ext3_dir_entry_2 {
> __le32 inode   = 0
> __le16 rec_len = 16
> __u8 name_len  = 4
> __u8 file_type = 0
> char name      = "dir_end"
> };

Sure, something like this.  The goal of this dir entry is to:
a) fill up the remaining space in the dir block
b) be large enough to be used later on when the start of the block has
   been consumed, so it shouldn't be too small.  It could even be as
   large as 4kB or 8kB or 32kB.

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


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.