aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2021-12-20 17:51:34 +0000
committerColin Percival <cperciva@FreeBSD.org>2021-12-29 20:41:08 +0000
commit19a172158cc12b3bdd848fead732f2151c36e526 (patch)
treed3cc4d3e94445b8bc5dbe719255087b811bf6138
parente6db5eb9ec7ba9edfc564fd5ade5fb40df9acebb (diff)
downloadsrc-19a172158cc12b3bdd848fead732f2151c36e526.tar.gz
src-19a172158cc12b3bdd848fead732f2151c36e526.zip
vfs_mountroot: Wait for GEOM idle post root holds
In the case of a root hold related to the initialization of a disk device, a flurry of GEOM tasting is likely to take place as soon as the device is initialized and the root hold is released. If we don't wait for GEOM idle it's easy for vfs_mountroot to "win" the race and proceed before the root filesystem GEOM is ready. Reviewed by: imp Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D33592
-rw-r--r--sys/kern/vfs_mountroot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c
index bb431c38a6f6..6257f9592d86 100644
--- a/sys/kern/vfs_mountroot.c
+++ b/sys/kern/vfs_mountroot.c
@@ -1005,6 +1005,7 @@ vfs_mountroot_wait(void)
hz);
TSUNWAIT("root mount");
}
+ g_waitidle();
TSEXIT();
}