Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 2009 18:30:00 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189974 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ffs
Message-ID:  <200903181830.n2IIU0F4033938@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Mar 18 18:30:00 2009
New Revision: 189974
URL: http://svn.freebsd.org/changeset/base/189974

Log:
  MFC:
  - If the g_access() call for the initial root mount fails, then fully
    cleanup.  Before the GEOM consumer would not have been closed.
  - Bump the reference on the character device being mounted while the
    associated devfs vnode is locked.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/ufs/ffs/ffs_vfsops.c

Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vfsops.c	Wed Mar 18 18:25:56 2009	(r189973)
+++ stable/7/sys/ufs/ffs/ffs_vfsops.c	Wed Mar 18 18:30:00 2009	(r189974)
@@ -622,10 +622,13 @@ ffs_mountfs(devvp, mp, td)
 	struct g_consumer *cp;
 	struct mount *nmp;
 
-	dev = devvp->v_rdev;
+	bp = NULL;
+	ump = NULL;
 	cred = td ? td->td_ucred : NOCRED;
-
 	ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
+
+	dev = devvp->v_rdev;
+	dev_ref(dev);
 	DROP_GIANT();
 	g_topology_lock();
 	error = g_vfs_open(devvp, &cp, "ffs", ronly ? 0 : 1);
@@ -640,8 +643,7 @@ ffs_mountfs(devvp, mp, td)
 	PICKUP_GIANT();
 	VOP_UNLOCK(devvp, 0, td);
 	if (error)
-		return (error);
-	dev_ref(dev);
+		goto out;
 	if (devvp->v_rdev->si_iosize_max != 0)
 		mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max;
 	if (mp->mnt_iosize_max > MAXPHYS)
@@ -650,8 +652,6 @@ ffs_mountfs(devvp, mp, td)
 	devvp->v_bufobj.bo_private = cp;
 	devvp->v_bufobj.bo_ops = &ffs_ops;
 
-	bp = NULL;
-	ump = NULL;
 	fs = NULL;
 	sblockloc = 0;
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903181830.n2IIU0F4033938>