]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: Flush vcaches when a mount fails
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Sat, 19 Dec 2009 14:48:32 +0000 (14:48 +0000)
committerDerrick Brashear <shadow|account-1000005@unknown>
Sun, 20 Dec 2009 18:09:10 +0000 (10:09 -0800)
GetVCache (well, really NewVCache) creates a new vcache, with an attached
inode, and links it into the VLRU queue, regardless of whether it is
successful in populating that vcache or not. The attached inode, on Linux,
contains a reference to the super block of the filesystem. If the created
vcache is for the root, however, and populating that vcache failes, then mount
fails, and the super block is disposed of. This leaves us with a vcache in
the VLRU queue which contains a reference to a non-existent inode.

When ShakeLooseVCaches comes along a few minutes later, it attempts to discard
this inode. However, doing so fails because the inode no longer has a valid
super block.

Avoid this trauma by ensuring all vcaches are disposed of before the super
block goes away, in the event of a mount failure.

Change-Id: I68864f1ea401d24adba76164905a17de6ab3e6ce
Reviewed-on: http://gerrit.openafs.org/1003
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from 994ef0e7cab95e2fc6f47fc8838490112e432ffd)
Reviewed-on: http://gerrit.openafs.org/1008
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/LINUX/osi_vfsops.c

index 545b9fa47f8e05148973dabb0018bf2e98857ece..abd555eaa2d339e565cd97bdd9e1a825e8384dde 100644 (file)
@@ -166,6 +166,7 @@ afs_read_super(struct super_block *sb, void *data, int silent)
     code = afs_root(sb);
     if (code) {
        afs_globalVFS = NULL;
+       osi_linux_free_inode_pages();
 #if defined(AFS_LINUX26_ENV)
         module_put(THIS_MODULE);
 #else