]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: afs_fill_super: Call bdi_destroy on the failure path
authorAnders Kaseorg <andersk@mit.edu>
Tue, 12 Nov 2013 05:23:47 +0000 (00:23 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 13 Nov 2013 15:32:02 +0000 (07:32 -0800)
Without this, if AFS startup failed, then trying to start AFS again
triggers these warnings:

WARNING: CPU: 3 PID: 657 at /build/buildd/linux-3.12.0/fs/sysfs/dir.c:526 sysfs_add_one+0xa5/0xd0()
sysfs: cannot create duplicate filename '/devices/virtual/bdi/afs'

WARNING: CPU: 3 PID: 657 at /build/buildd/linux-3.12.0/lib/kobject.c:196 kobject_add_internal+0x1f4/0x300()
kobject_add_internal failed for afs with -EEXIST, don't try to register things with the same name in the same directory.

and leads to general system instability.  This can be reproduced by
starting AFS twice with an empty cache, dynroot disabled, and no
network.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10448
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit f5f53cb0a1f326ed4695621f6a5a63f798444549)

Change-Id: I6dda2fb561279d445bb7fdfdb601b64b326cd4c1
Reviewed-on: http://gerrit.openafs.org/10454
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/LINUX/osi_vfsops.c

index bc951a22bc7d85b836c4ccf2a478f0d07453bbb5..e0bea4825e38f92094b71e6786866f370e39c371 100644 (file)
@@ -147,6 +147,10 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
     if (code) {
        afs_globalVFS = NULL;
        afs_FlushAllVCaches();
+#if defined(HAVE_LINUX_BDI_INIT)
+       bdi_destroy(afs_backing_dev_info);
+#endif
+       osi_Free(afs_backing_dev_info, sizeof(struct backing_dev_info));
         module_put(THIS_MODULE);
     }