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
drivers-testing.txt
Testing suspend and resume support in device drivers
	(C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL

1. Preparing the test system

Unfortunately, to effectively test the support for the system-wide suspend and
resume transitions in a driver, it is necessary to suspend and resume a fully
functional system with this driver loaded.  Moreover, that should be done
several times, preferably several times in a row, and separately for hibernation
(aka suspend to disk or STD) and suspend to RAM (STR), because each of these
cases involves slightly different operations and different interactions with
the machine's BIOS.

Of course, for this purpose the test system has to be known to suspend and
resume without the driver being tested.  Thus, if possible, you should first
resolve all suspend/resume-related problems in the test system before you start
testing the new driver.  Please see Documentation/power/basic-pm-debugging.txt
for more information about the debugging of suspend/resume functionality.

2. Testing the driver

Once you have resolved the suspend/resume-related problems with your test system
without the new driver, you are ready to test it:

a) Build the driver as a module, load it and try the test modes of hibernation
   (see: Documents/power/basic-pm-debugging.txt, 1).

b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
   "platform" modes (see: Documents/power/basic-pm-debugging.txt, 1).

c) Compile the driver directly into the kernel and try the test modes of
   hibernation.

d) Attempt to hibernate with the driver compiled directly into the kernel
   in the "reboot", "shutdown" and "platform" modes.

e) Try the test modes of suspend (see: Documents/power/basic-pm-debugging.txt,
   2).  [As far as the STR tests are concerned, it should not matter whether or
   not the driver is built as a module.]

f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
   (see: Documents/power/basic-pm-debugging.txt, 2).

Each of the above tests should be repeated several times and the STD tests
should be mixed with the STR tests.  If any of them fails, the driver cannot be
regarded as suspend/resume-safe.
back to top