Source-Changes archive

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

Re: CVS commit: src/sys/fs/efs



On Sat, Sep 15, 2007 at 06:32:42PM -0400, Stephen M. Rumble wrote:

> Quoting David Laight <david%l8s.co.uk@localhost>:
> 
> >On Sat, Sep 08, 2007 at 06:18:00PM +0000, Stephen M. Rumble wrote:
> >>
> >>Module Name:        src
> >>Committed By:       rumble
> >>Date:               Sat Sep  8 18:18:00 UTC 2007
> >>
> >>Modified Files:
> >>    src/sys/fs/efs: efs_vnops.c
> >>
> >>Log Message:
> >>In efs_readdir don't foolishly allocate and free dirents for each entry
> >>before copying them out, rather just use a single one. Further, follow
> >>the example of tmpfs and others by simply allocating on the stack.
> >
> >How big is the 'dirent' structure ?
> >Allocating a non-trivial structures on the kernel stack will lead to
> >stack overflow problems.
> 
> Ca. 512 bytes. Antti and I discussed similar reservations, but since a  
> number of filesystems do the same thing (ext2fs and about half of  
> sys/fs), I decided to follow their example, whether it be good or not.  
> Fixing the behaviour of all other filesystems later, should it be  
> deemed a worthy pursuit, would be a straightforward exercise anyway.
> 
> Has anyone a strong opinion? I could drum up patches and I volunteer  
> pooka to proof them.

I think that 512 bytes is on the large side for the stack, on a lot of
architectures that's a signficant fraction of it.

Thanks,
Andrew



Home | Main Index | Thread Index | Old Index