summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-11-04 09:11:22 +0000
committerphk <phk@FreeBSD.org>2004-11-04 09:11:22 +0000
commit248c63e073c6f7232b999239a65bb0e38ffd2616 (patch)
tree1270ac9c9190e7ab3c48743613f17dfebf63b30f /sys/ufs
parente9aa533e846bc33434e0ef5fa26e50ccea987fb1 (diff)
downloadFreeBSD-src-248c63e073c6f7232b999239a65bb0e38ffd2616.zip
FreeBSD-src-248c63e073c6f7232b999239a65bb0e38ffd2616.tar.gz
Don't grab the exclusive bit on a root filesystem until we are willing
to mount it. Doing so prevented fsck to be run after a refused mount.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 6c10052..3a27b5a 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -266,20 +266,6 @@ ffs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td)
}
VOP_UNLOCK(devvp, 0, td);
}
- DROP_GIANT();
- g_topology_lock();
- /*
- * If we're the root device, we may not have an E count
- * yet, get it now.
- */
- if (ump->um_cp->ace == 0)
- error = g_access(ump->um_cp, 0, 1, 1);
- else
- error = g_access(ump->um_cp, 0, 1, 0);
- g_topology_unlock();
- PICKUP_GIANT();
- if (error)
- return (error);
fs->fs_flags &= ~FS_UNCLEAN;
if (fs->fs_clean == 0) {
fs->fs_flags |= FS_UNCLEAN;
@@ -295,6 +281,20 @@ ffs_omount(struct mount *mp, char *path, caddr_t data, struct thread *td)
return (EPERM);
}
}
+ DROP_GIANT();
+ g_topology_lock();
+ /*
+ * If we're the root device, we may not have an E count
+ * yet, get it now.
+ */
+ if (ump->um_cp->ace == 0)
+ error = g_access(ump->um_cp, 0, 1, 1);
+ else
+ error = g_access(ump->um_cp, 0, 1, 0);
+ g_topology_unlock();
+ PICKUP_GIANT();
+ if (error)
+ return (error);
if ((error = vn_start_write(NULL, &mp, V_WAIT)) != 0)
return (error);
fs->fs_ronly = 0;
OpenPOWER on IntegriCloud