summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-09-27 19:29:52 +0000
committermarcel <marcel@FreeBSD.org>2008-09-27 19:29:52 +0000
commit0cc6ca46af6d1bf2fca0798f132bbac494d49f8f (patch)
tree253ea621f2cb4445b3691b0c22b20a1395e994d4 /sys
parentee0f3b34ddd2bf5dd382037bab99a97f89ab5b8c (diff)
downloadFreeBSD-src-0cc6ca46af6d1bf2fca0798f132bbac494d49f8f.zip
FreeBSD-src-0cc6ca46af6d1bf2fca0798f132bbac494d49f8f.tar.gz
Hold the root mount while we're tasting. It is possible
that a nested partition (typically the BSD disklabel) is not done tasting while the root file system is being mounted. While this is rare, it's still possible.
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/part/g_part.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 6a64a12..c154871 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -1443,6 +1443,7 @@ g_part_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
struct g_geom *gp;
struct g_part_entry *entry;
struct g_part_table *table;
+ struct root_hold_token *rht;
int attr, depth;
int error;
@@ -1464,6 +1465,7 @@ g_part_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
return (NULL);
}
+ rht = root_mount_hold(mp->name);
g_topology_unlock();
/*
@@ -1516,11 +1518,13 @@ g_part_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
g_part_new_provider(gp, table, entry);
}
+ root_mount_rel(rht);
g_access(cp, -1, 0, 0);
return (gp);
fail:
g_topology_lock();
+ root_mount_rel(rht);
g_access(cp, -1, 0, 0);
g_part_wither(gp, error);
return (NULL);
OpenPOWER on IntegriCloud