Page MenuHomeFreeBSD

D52037.id160640.diff
No OneTemporary

D52037.id160640.diff

diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c
--- a/sys/kern/vfs_init.c
+++ b/sys/kern/vfs_init.c
@@ -387,7 +387,7 @@
static int once;
struct vfsconf *tvfc;
uint32_t hashval;
- int secondpass;
+ int error, secondpass;
if (!once) {
vattr_null(&va_null);
@@ -497,16 +497,30 @@
vfc->vfc_vfsops = &vfsops_sigdefer;
}
- if (vfc->vfc_flags & VFCF_JAIL)
- prison_add_vfs(vfc);
-
/*
* Call init function for this VFS...
*/
if ((vfc->vfc_flags & VFCF_SBDRY) != 0)
- vfc->vfc_vfsops_sd->vfs_init(vfc);
+ error = vfc->vfc_vfsops_sd->vfs_init(vfc);
else
- vfc->vfc_vfsops->vfs_init(vfc);
+ error = vfc->vfc_vfsops->vfs_init(vfc);
+
+ if (error != 0) {
+ /*
+ * We ony bother unwinding maxvfsconf in the case that
+ * vfs.typenumhash isn't set. Otherwise, a new fs loading will
+ * just not find a collision.
+ */
+ if (vfs_typenumhash == 0)
+ maxvfsconf--;
+ TAILQ_REMOVE(&vfsconf, vfc, vfc_list);
+ vfsconf_unlock();
+ return (error);
+ }
+
+ if (vfc->vfc_flags & VFCF_JAIL)
+ prison_add_vfs(vfc);
+
vfsconf_unlock();
/*

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 26, 7:32 AM (11 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30371186
Default Alt Text
D52037.id160640.diff (1 KB)

Event Timeline