Subject: Re: kern/31430: ptyfs isn't getting mtime right
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Christos Zoulas <christos@zoulas.com>
List: netbsd-bugs
Date: 10/12/2005 16:41:03
The following reply was made to PR kern/31430; it has been noted by GNATS.

From: christos@zoulas.com (Christos Zoulas)
To: Simon Burge <simonb@wasabisystems.com>,
	YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Cc: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/31430: ptyfs isn't getting mtime right
Date: Wed, 12 Oct 2005 12:40:11 -0400

 On Oct 13,  2:36am, simonb@wasabisystems.com (Simon Burge) wrote:
 -- Subject: Re: kern/31430: ptyfs isn't getting mtime right
 
 | YAMAMOTO Takashi wrote:
 | 
 | > > The patch below is a result of a discussion off-line with Christos.
 | > > The granularity of the mtime doesn't need to be down to the nanosecond
 | > > - using the kernel "time" variable (which is updated on each
 | > > hardclock call) saves a potentially relatively expensive call to
 | > > microtime/nanotime for each write, and is more than accurate enough to
 | > > track pty idle times.
 | > 
 | > it isn't good to mix "time" and nanotime
 | > because it can make timestamps go backward sometimes.
 | 
 | You're suggesting that ptyfs_itimes() use "time" as well if any of the
 | timespec pointers are NULL then?  Or a different solution?
 
 He is saying that there are other callers of ptyfs_itime() that call it
 with nanotime() or NULL, so the results can be inconsistent. I don't think
 that this is very important in this case (considering that ptyfs is not
 even enabled by default, and right now times are completely off). I do
 think that we should work towards making everything in the kernel use
 timespecs, so that we don't have this problem.
 
 christos