Revision e6da7c9fed111ba1243297ee6eda8e24ae11c384 authored by Eric Sandeen on 23 May 2009, 19:30:12 UTC, committed by Felix Blyakher on 02 June 2009, 03:59:38 UTC
In the case where growing a filesystem would leave the last AG
too small, the fixup code has an overflow in the calculation
of the new size with one fewer ag, because "nagcount" is a 32
bit number.  If the new filesystem has > 2^32 blocks in it
this causes a problem resulting in an EINVAL return from growfs:

 # xfs_io -f -c "truncate 19998630180864" fsfile
 # mkfs.xfs -f -bsize=4096 -dagsize=76288719b,size=3905982455b fsfile
 # mount -o loop fsfile /mnt
 # xfs_growfs /mnt

meta-data=/dev/loop0             isize=256    agcount=52,
agsize=76288719 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=3905982455, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=32768, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Invalid argument

Reported-by: richard.ems@cape-horn-eng.com
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
1 parent 1f23920
Raw File
memory.txt
There are several classic problems related to memory on Linux
systems.

	1) There are some buggy motherboards which cannot properly 
	   deal with the memory above 16MB.  Consider exchanging
	   your motherboard.

	2) You cannot do DMA on the ISA bus to addresses above
	   16M.  Most device drivers under Linux allow the use
           of bounce buffers which work around this problem.  Drivers
	   that don't use bounce buffers will be unstable with
	   more than 16M installed.  Drivers that use bounce buffers
	   will be OK, but may have slightly higher overhead.
	
	3) There are some motherboards that will not cache above
	   a certain quantity of memory.  If you have one of these
	   motherboards, your system will be SLOWER, not faster
	   as you add more memory.  Consider exchanging your 
           motherboard.

All of these problems can be addressed with the "mem=XXXM" boot option
(where XXX is the size of RAM to use in megabytes).  
It can also tell Linux to use less memory than is actually installed.
If you use "mem=" on a machine with PCI, consider using "memmap=" to avoid
physical address space collisions.

See the documentation of your boot loader (LILO, loadlin, etc.) about
how to pass options to the kernel.

There are other memory problems which Linux cannot deal with.  Random
corruption of memory is usually a sign of serious hardware trouble.
Try:

	* Reducing memory settings in the BIOS to the most conservative 
          timings.

	* Adding a cooling fan.

	* Not overclocking your CPU.

	* Having the memory tested in a memory tester or exchanged
	  with the vendor. Consider testing it with memtest86 yourself.
	
	* Exchanging your CPU, cache, or motherboard for one that works.

	* Disabling the cache from the BIOS.

	* Try passing the "mem=4M" option to the kernel to limit
	  Linux to using a very small amount of memory. Use "memmap="-option
	  together with "mem=" on systems with PCI to avoid physical address
	  space collisions.


Other tricks:

	* Try passing the "no-387" option to the kernel to ignore
	  a buggy FPU.

	* Try passing the "no-hlt" option to disable the potentially
          buggy HLT instruction in your CPU.
back to top