summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-02-11 22:19:54 +0000
committerjhb <jhb@FreeBSD.org>2009-02-11 22:19:54 +0000
commit6f82ac1ceb31d819ced6b5f2a93db4518a1805d7 (patch)
treec90e19bbb18790289547f2711b159136d8398f6e
parent32a5c53f3b3f172a96e05bc3bfb1008892e2bb48 (diff)
downloadFreeBSD-src-6f82ac1ceb31d819ced6b5f2a93db4518a1805d7.zip
FreeBSD-src-6f82ac1ceb31d819ced6b5f2a93db4518a1805d7.tar.gz
- 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. Reviewed by: kib
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index b9ad090..95dbeb1 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -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);
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;
/*
OpenPOWER on IntegriCloud