From owner-svn-src-all@FreeBSD.ORG Thu Feb 21 02:41:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82EE4617; Thu, 21 Feb 2013 02:41:38 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 762D2CFF; Thu, 21 Feb 2013 02:41:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1L2fcPS034727; Thu, 21 Feb 2013 02:41:38 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1L2fcAe034726; Thu, 21 Feb 2013 02:41:38 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201302210241.r1L2fcAe034726@svn.freebsd.org> From: Jamie Gritton Date: Thu, 21 Feb 2013 02:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247071 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 02:41:38 -0000 Author: jamie Date: Thu Feb 21 02:41:37 2013 New Revision: 247071 URL: http://svnweb.freebsd.org/changeset/base/247071 Log: Don't worry if a module is already loaded when looking for a fstype to mount (possible in a race condition). Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/vfs_init.c Modified: head/sys/kern/vfs_init.c ============================================================================== --- head/sys/kern/vfs_init.c Thu Feb 21 02:40:20 2013 (r247070) +++ head/sys/kern/vfs_init.c Thu Feb 21 02:41:37 2013 (r247071) @@ -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, struc /* 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); }