Here's the patch. ----- Original Message ----- From: "Stephen Lord" <lord@sgi.com> To: "Sebastian Kun" <seb@consensys.com> Cc: <linux-xfs@oss.sgi.com>; "James A Goodwin" <jagoodwi@us.ibm.com>; "Steve Cooper" <scoop@consensys.com> Sent: Thursday, May 23, 2002 11:20 AM Subject: Re: XFS stack overflow > Sebastian Kun wrote: > > >Hello, > > > >There are several routines in XFS that use up an inordinately large amount > >of the 6KB per-process stack (6496 bytes with the kernel we're using). The > >worst offender is xfs_dir2_sf_to_block, which puts a 2KB char array right on > >the stack. This has contributed to stack overflows during heavy writing. > >The attached patch changes this routine so that it kmallocs the structure > >instead. > > > >I've seen this problem with both XFS 1.1, and the XFS-2.4.18 patch located > >on the FTP site. I looked at the web CVS tree today, and it also has this > >potential for overflow. > > > >System specs: > > > >2x1.26GHz P3-T, Intel SDS2, 3GB RAM, 1TB RAID5 array > >Kernel version: 2.4.18 with SMP, 4GB Highmem with 2GB/2GB split, KDB, and > >frame pointers > > + Neil Brown's Bd-nfsall NFS server patch and Trond's nfs_all client > >patch (minus TCP server code) > >XFS patch: xfs-1.1 (XFS_FS=y, XFS_RT not set, XFS_QUOTA=y, XFS_DMAPI=y) > >mkfs: -f -d sunit=128,swidth=1664 -l size=32768b > >mount: defaults,noatime,sunit=128,swidth=1664,logbufs=8 > > > > > >Sebastian Kun > >Driver developer, Consensys RAIDZONE > > > Interesting, I was not aware that was on the stack. yes it is being a > bit greedy there. > > Two things, your attachment did not make it here, and once you do mkfs with > stripe options, you do not need to specify them on mount, it gets them > from the > super block. The mount options are intended for changing the stripe layout > from the mkfs specificed values. > > Steve > >
Attachment:
linux-2.4.18-xfs-stackfix.patch
Description: Binary data