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
History
File Mode Size
ABI
DocBook
PCI
RCU
accounting
acpi
aoe
arm
auxdisplay
blackfin
block
blockdev
cdrom
cgroups
connector
console
cpu-freq
cpuidle
cris
crypto
development-process
device-mapper
driver-model
dvb
early-userspace
fault-injection
fb
filesystems
firmware_class
frv
hwmon
i2c
i2o
ia64
ide
infiniband
input
ioctl
isdn
ja_JP
kbuild
kdump
ko_KR
laptops
lguest
m68k
make
mips
misc-devices
mn10300
mtd
namespaces
netlabel
networking
parisc
pcmcia
power
powerpc
prctl
s390
scheduler
scsi
serial
sh
sound
sparc
spi
sysctl
telephony
thermal
timers
tracers
uml
usb
video4linux
vm
w1
watchdog
wimax
x86
zh_CN
00-INDEX -rw-r--r-- 11.9 KB
BUG-HUNTING -rw-r--r-- 8.1 KB
Changes -rw-r--r-- 11.5 KB
CodingStyle -rw-r--r-- 29.1 KB
DMA-API.txt -rw-r--r-- 27.7 KB
DMA-ISA-LPC.txt -rw-r--r-- 5.2 KB
DMA-attributes.txt -rw-r--r-- 1.3 KB
DMA-mapping.txt -rw-r--r-- 27.3 KB
HOWTO -rw-r--r-- 28.6 KB
IO-mapping.txt -rw-r--r-- 7.9 KB
IPMI.txt -rw-r--r-- 27.0 KB
IRQ-affinity.txt -rw-r--r-- 2.1 KB
IRQ.txt -rw-r--r-- 962 bytes
Intel-IOMMU.txt -rw-r--r-- 3.9 KB
Makefile -rw-r--r-- 143 bytes
ManagementStyle -rw-r--r-- 12.9 KB
SAK.txt -rw-r--r-- 2.8 KB
SELinux.txt -rw-r--r-- 1.0 KB
SM501.txt -rw-r--r-- 2.8 KB
SecurityBugs -rw-r--r-- 1.8 KB
Smack.txt -rw-r--r-- 21.0 KB
SubmitChecklist -rw-r--r-- 3.5 KB
SubmittingDrivers -rw-r--r-- 6.2 KB
SubmittingPatches -rw-r--r-- 25.4 KB
VGA-softcursor.txt -rw-r--r-- 2.0 KB
applying-patches.txt -rw-r--r-- 19.5 KB
atomic_ops.txt -rw-r--r-- 19.0 KB
bad_memory.txt -rw-r--r-- 1.1 KB
basic_profiling.txt -rw-r--r-- 1.7 KB
binfmt_misc.txt -rw-r--r-- 6.0 KB
braille-console.txt -rw-r--r-- 1.4 KB
bt8xxgpio.txt -rw-r--r-- 4.3 KB
c2port.txt -rw-r--r-- 2.8 KB
cachetlb.txt -rw-r--r-- 15.9 KB
cpu-hotplug.txt -rw-r--r-- 14.6 KB
cpu-load.txt -rw-r--r-- 3.0 KB
cputopology.txt -rw-r--r-- 2.9 KB
credentials.txt -rw-r--r-- 20.4 KB
dcdbas.txt -rw-r--r-- 3.6 KB
debugging-modules.txt -rw-r--r-- 954 bytes
debugging-via-ohci1394.txt -rw-r--r-- 7.5 KB
dell_rbu.txt -rw-r--r-- 4.9 KB
devices.txt -rw-r--r-- 115.9 KB
dmaengine.txt -rw-r--r-- 42 bytes
dontdiff -rw-r--r-- 1.9 KB
dynamic-debug-howto.txt -rw-r--r-- 8.4 KB
edac.txt -rw-r--r-- 20.8 KB
eisa.txt -rw-r--r-- 7.1 KB
email-clients.txt -rw-r--r-- 9.0 KB
exception.txt -rw-r--r-- 12.1 KB
feature-removal-schedule.txt -rw-r--r-- 15.6 KB
ftrace.txt -rw-r--r-- 54.4 KB
gpio.txt -rw-r--r-- 25.9 KB
highuid.txt -rw-r--r-- 2.4 KB
hw_random.txt -rw-r--r-- 3.5 KB
ics932s401 -rw-r--r-- 1018 bytes
initrd.txt -rw-r--r-- 14.1 KB
io-mapping.txt -rw-r--r-- 3.2 KB
io_ordering.txt -rw-r--r-- 1.9 KB
iostats.txt -rw-r--r-- 7.9 KB
irqflags-tracing.txt -rw-r--r-- 2.6 KB
isapnp.txt -rw-r--r-- 433 bytes
java.txt -rw-r--r-- 10.7 KB
kernel-doc-nano-HOWTO.txt -rw-r--r-- 10.9 KB
kernel-docs.txt -rw-r--r-- 34.8 KB
kernel-parameters.txt -rw-r--r-- 80.3 KB
keys-request-key.txt -rw-r--r-- 7.4 KB
keys.txt -rw-r--r-- 46.2 KB
kobject.txt -rw-r--r-- 16.9 KB
kprobes.txt -rw-r--r-- 20.9 KB
kref.txt -rw-r--r-- 6.2 KB
ldm.txt -rw-r--r-- 3.9 KB
leds-class.txt -rw-r--r-- 3.8 KB
local_ops.txt -rw-r--r-- 6.1 KB
lockdep-design.txt -rw-r--r-- 8.8 KB
lockstat.txt -rw-r--r-- 7.9 KB
logo.svg -rw-r--r-- 303.2 KB
logo.txt -rw-r--r-- 201 bytes
magic-number.txt -rw-r--r-- 9.7 KB
markers.txt -rw-r--r-- 4.2 KB
mca.txt -rw-r--r-- 11.3 KB
md.txt -rw-r--r-- 19.6 KB
memory-barriers.txt -rw-r--r-- 76.2 KB
memory-hotplug.txt -rw-r--r-- 14.0 KB
memory.txt -rw-r--r-- 2.1 KB
mono.txt -rw-r--r-- 2.5 KB
mutex-design.txt -rw-r--r-- 5.8 KB
nmi_watchdog.txt -rw-r--r-- 4.2 KB
nommu-mmap.txt -rw-r--r-- 11.2 KB
numastat.txt -rw-r--r-- 861 bytes
oops-tracing.txt -rw-r--r-- 12.3 KB
parport-lowlevel.txt -rw-r--r-- 32.2 KB
parport.txt -rw-r--r-- 8.8 KB
pi-futex.txt -rw-r--r-- 5.7 KB
pnp.txt -rw-r--r-- 6.8 KB
preempt-locking.txt -rw-r--r-- 5.2 KB
printk-formats.txt -rw-r--r-- 1.0 KB
prio_tree.txt -rw-r--r-- 5.2 KB
rbtree.txt -rw-r--r-- 6.6 KB
rfkill.txt -rw-r--r-- 26.2 KB
robust-futex-ABI.txt -rw-r--r-- 8.7 KB
robust-futexes.txt -rw-r--r-- 9.4 KB
rt-mutex-design.txt -rw-r--r-- 32.8 KB
rt-mutex.txt -rw-r--r-- 3.5 KB
rtc.txt -rw-r--r-- 15.1 KB
serial-console.txt -rw-r--r-- 4.0 KB
sgi-ioc4.txt -rw-r--r-- 2.0 KB
sgi-visws.txt -rw-r--r-- 678 bytes
sparse.txt -rw-r--r-- 2.7 KB
spinlocks.txt -rw-r--r-- 8.8 KB
stable_api_nonsense.txt -rw-r--r-- 9.2 KB
stable_kernel_rules.txt -rw-r--r-- 2.8 KB
svga.txt -rw-r--r-- 14.1 KB
sysfs-rules.txt -rw-r--r-- 8.1 KB
sysrq.txt -rw-r--r-- 11.4 KB
tracepoints.txt -rw-r--r-- 4.0 KB
unaligned-memory-access.txt -rw-r--r-- 10.0 KB
unicode.txt -rw-r--r-- 6.5 KB
unshare.txt -rw-r--r-- 13.1 KB
video-output.txt -rw-r--r-- 1.1 KB
volatile-considered-harmful.txt -rw-r--r-- 5.6 KB
voyager.txt -rw-r--r-- 3.4 KB
zorro.txt -rw-r--r-- 2.8 KB

back to top