Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jun 2023 02:23:49 +0300
From:      Sulev-Madis Silber <madis555@hot.ee>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   new syctl to allow ignoring time from fs if no rtc found
Message-ID:  <CAEawv95VfWEXH-efu0QMbpFZZg5TPiDjP=abrzz=fQy%2B031FYw@mail.gmail.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]

[-- Attachment #2 --]
Index: sys/kern/vfs_mountroot.c
===================================================================
--- sys/kern/vfs_mountroot.c	(revision 274644)
+++ sys/kern/vfs_mountroot.c	(working copy)
@@ -968,14 +968,16 @@
 	 * timestamps we encounter.
 	 */
 	timebase = 0;
-	mtx_lock(&mountlist_mtx);
-	mp = TAILQ_FIRST(&mountlist);
-	while (mp != NULL) {
-		if (mp->mnt_time > timebase)
-			timebase = mp->mnt_time;
-		mp = TAILQ_NEXT(mp, mnt_list);
+	if (kern_getenv("debug.no_timestamp_from_filesystem") == NULL) {
+		mtx_lock(&mountlist_mtx);
+		mp = TAILQ_FIRST(&mountlist);
+		while (mp != NULL) {
+			if (mp->mnt_time > timebase)
+				timebase = mp->mnt_time;
+			mp = TAILQ_NEXT(mp, mnt_list);
+		}
+		mtx_unlock(&mountlist_mtx);
 	}
-	mtx_unlock(&mountlist_mtx);
 	inittodr(timebase);
 
 	/* Keep prison0's root in sync with the global rootvnode. */
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEawv95VfWEXH-efu0QMbpFZZg5TPiDjP=abrzz=fQy%2B031FYw>