xfs: register the inode cache shrinker before quotachecks
authorDave Chinner <dchinner@redhat.com>
Fri, 25 Mar 2011 22:14:57 +0000 (09:14 +1100)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:40:38 +0000 (11:40 -0700)
commited3bd9f9939d6e0e391dc341ec209293a2f32379
tree3400bf9f4412d148bc117211e0820021d4740308
parentf35d4d7e67f599556c4807bf992f34e203f8dd55
xfs: register the inode cache shrinker before quotachecks

BugLink: http://bugs.launchpad.net/bugs/761134

commit 704b2907c2d47ceb187c0e25a6bbc2174b198f2f upstream.

During mount, we can do a quotacheck that involves a bulkstat pass
on all inodes. If there are more inodes in the filesystem than can
be held in memory, we require the inode cache shrinker to run to
ensure that we don't run out of memory.

Unfortunately, the inode cache shrinker is not registered until we
get to the end of the superblock setup process, which is after a
quotacheck is run if it is needed. Hence we need to register the
inode cache shrinker earlier in the mount process so that we don't
OOM during mount. This requires that we also initialise the syncd
work before we register the shrinker, so we nee dto juggle that
around as well.

While there, make sure that we have set up the block sizes in the
VFS superblock correctly before the quotacheck is run so that any
inodes that are cached as a result of the quotacheck have their
block size fields set up correctly.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/xfs/linux-2.6/xfs_super.c