diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-21 15:06:19 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-21 15:06:19 +0000 |
commit | 8746bf6a5fd085c8c45d8328297670021802c788 (patch) | |
tree | a1357a1a002c93f2edcf1fac678ce5bbc665b29f /sys/kern | |
parent | 066bbc97b6c386afc461fecd3fea4014a7a87ba4 (diff) | |
parent | 323dc265fee59e32efcba8259f0481a82dab15f6 (diff) | |
download | FreeBSD-src-8746bf6a5fd085c8c45d8328297670021802c788.zip FreeBSD-src-8746bf6a5fd085c8c45d8328297670021802c788.tar.gz |
MFC
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_init.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index 8172f18..eab48fb 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -122,7 +122,7 @@ struct vfsconf * vfs_byname_kld(const char *fstype, struct thread *td, int *error) { struct vfsconf *vfsp; - int fileid; + int fileid, loaded; vfsp = vfs_byname(fstype); if (vfsp != NULL) @@ -130,13 +130,17 @@ vfs_byname_kld(const char *fstype, struct thread *td, int *error) /* Try to load the respective module. */ *error = kern_kldload(td, fstype, &fileid); + loaded = (*error == 0); + if (*error == EEXIST) + *error = 0; if (*error) return (NULL); /* Look up again to see if the VFS was loaded. */ vfsp = vfs_byname(fstype); if (vfsp == NULL) { - (void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE); + if (loaded) + (void)kern_kldunload(td, fileid, LINKER_UNLOAD_FORCE); *error = ENODEV; return (NULL); } |