lkml.org 
[lkml]   [2006]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 1/2] ext3: enlarge blocksize and fix rec_len overflow
Andreas Dilger wrote:
> On Jun 29, 2006 11:10 -0700, Daniel Phillips wrote:
>>Andreas Dilger 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. 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.
>>
>>Then why not introduce a little symmetry by making max rec_len 2**15 and
>>treat big directory blocks as an array of smaller ones? I dimly recall
>>the page-cache oriented Ext2 dir code already does this.
>
> I have no objection to this at all, but I think it will lead to a slightly
> more complex implementation. We even discussed in the distant past to
> make large directories a series of 4kB "chunks", for fs blocksize >= 4kB.
> This has negative implications for large filenames because the internal
> free space fragmentation is high, but has the advantage that it might
> eventually still be usable if we can get blocksize > PAGE_SIZE.
>
> The difficulty is that when freeing dir entires you would have to be
> concerned with a merging a dir_entry that is spanning the middle
> of a 2^16 block.

That is easy, just don't let an entry span subblocks by not letting
delete merge past the end of a subblock, just a minor tweak. New block
initialization needs an outer loop on subblocks and that's it, I think.

Regards,

Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-30 00:17    [W:0.051 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site