diff options
author | marcel <marcel@FreeBSD.org> | 2005-03-25 01:56:12 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2005-03-25 01:56:12 +0000 |
commit | f5cbb5f36a4e70f668a5906defaec7cbc5f2b661 (patch) | |
tree | 5d1bf278635717fdf395de0480f36d3e0f076c9f /sys/kern | |
parent | 53feee26e6a784ec5b10278f5fecc6c502bfa2eb (diff) | |
download | FreeBSD-src-f5cbb5f36a4e70f668a5906defaec7cbc5f2b661.zip FreeBSD-src-f5cbb5f36a4e70f668a5906defaec7cbc5f2b661.tar.gz |
Fix inittodr() invocation. Now that devfs is mounted before the
actual root file system is mounted, the first entry on the mountlist
is not the root file system and the timestamp for that entry is
typically 0. Passing that to inittodr() caused annoying errors on
alpha and ia64.
So, call inittodr() for all file systems on mountlist, but only when
the timestamp (mnt_time) is non-zero.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_mount.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 5ff2c20..0f59019 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1262,12 +1262,26 @@ vfs_mountroot_try(const char *mountfrom) "from", path, NULL); if (error == 0) { + /* + * We mount devfs prior to mounting the / FS, so the first + * entry will typically be devfs. + */ mp = TAILQ_FIRST(&mountlist); - - /* sanity check system clock against root fs timestamp */ - inittodr(mp->mnt_time); + KASSERT(mp != NULL, ("%s: mountlist is empty", __func__)); vfs_unbusy(mp, curthread); + /* + * Iterate over all currently mounted file systems and use + * the time stamp found to check and/or initialize the RTC. + * Typically devfs has no time stamp and the only other FS + * is the actual / FS. + */ + do { + if (mp->mnt_time != 0) + inittodr(mp->mnt_time); + mp = TAILQ_NEXT(mp, mnt_list); + } while (mp != NULL); + devfs_fixup(curthread); } return (error); |