Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Feb 2003 22:10:41 +0100
From:      phk@freebsd.org
To:        "Andrey A. Chernov" <ache@nagual.pp.ru>
Cc:        current@freebsd.org
Subject:   Re: Wrong date for DEVFS entries 
Message-ID:  <45096.1044479441@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 06 Feb 2003 00:03:07 %2B0300." <20030205210307.GA1222@nagual.pp.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20030205210307.GA1222@nagual.pp.ru>, "Andrey A. Chernov" writes:
>On Wed, Feb 05, 2003 at 20:52:54 +0100, phk@freebsd.org wrote:
>> 
>> My guess:  Your RTC has the wrong time and ntpdate or similar stepped
>> your clock to be correct.
>
>It is each boot repeated effect, not one time.
>I run local clock in BIOS and use adjkerntz(8) to correct kernel time to 
>GMT, via standard /etc/wall_cmos_clock knob. It there any chance that 
>DEVFS comes up in the middle? If yes, is there any ideas for workaround?

You can try this patch instead.  It has a different side effect:
if you reset your clock the (untouched) timestamps will change.

Index: devfs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/devfs/devfs_vnops.c,v
retrieving revision 1.60
diff -u -r1.60 devfs_vnops.c
--- devfs_vnops.c	29 Jan 2003 22:36:45 -0000	1.60
+++ devfs_vnops.c	5 Feb 2003 19:58:52 -0000
@@ -243,22 +243,19 @@
 	} while (0)
 
 	if (vp->v_type != VCHR)  {
-		fix(de->de_atime);
 		vap->va_atime = de->de_atime;
-		fix(de->de_mtime);
 		vap->va_mtime = de->de_mtime;
-		fix(de->de_ctime);
 		vap->va_ctime = de->de_ctime;
 	} else {
 		dev = vp->v_rdev;
-		fix(dev->si_atime);
 		vap->va_atime = dev->si_atime;
-		fix(dev->si_mtime);
 		vap->va_mtime = dev->si_mtime;
-		fix(dev->si_ctime);
 		vap->va_ctime = dev->si_ctime;
 		vap->va_rdev = dev->si_udev;
 	}
+	fix(vap->va_atime);
+	fix(vap->va_mtime);
+	fix(vap->va_ctime);
 	vap->va_gen = 0;
 	vap->va_flags = 0;
 	vap->va_nlink = de->de_links;
-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45096.1044479441>