From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 02:00:05 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDA32E34; Wed, 1 Apr 2015 02:00:04 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id AB191C6A; Wed, 1 Apr 2015 02:00:04 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 373F6D638DD; Wed, 1 Apr 2015 12:59:55 +1100 (AEDT) Date: Wed, 1 Apr 2015 12:59:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r280308 - head/sys/fs/devfs In-Reply-To: <20150330103355.GD2379@kib.kiev.ua> Message-ID: <20150401124524.B1349@besplex.bde.org> References: <20150322162507.GD2379@kib.kiev.ua> <201503221825.t2MIP7jv096531@gw.catspoiler.org> <20150329175137.GD95224@stack.nl> <20150329184238.GB2379@kib.kiev.ua> <20150330145148.C1660@besplex.bde.org> <20150330103355.GD2379@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=Za4kaKlA c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=0Ncl0vLHgX-B8fq7w2QA:9 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Jilles Tjoelker , svn-src-all@freebsd.org, delphij@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Don Lewis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2015 02:00:05 -0000 On Mon, 30 Mar 2015, Konstantin Belousov wrote: > On Mon, Mar 30, 2015 at 03:14:10PM +1100, Bruce Evans wrote: >> File timestamps use CLOCK_REALTIME, so they are supposed to go backwards >> sometimes. More importantly, if the time is set to a future time (by >> utimes(), etc., not due to a clock step), this prevents it being correted. >> I think you only want to do a null update if tv_nsec is nonzero due to a >> previous setting with vfs_timestamp(), and the new second hasn't arrived >> yet. Something like: >> >> if (tsp->tv_sec != ts) ... >> >> If '<', then as above. If '>', it means a correction by >= 1 second >> (strictly greater if tv_nsec != 0). The initial value tv_nsec is >> irrelevant in both cases. The future times happen often in practice. Any time the system is on local time East of Greenwich, using a device file early in the boot sets its timestamps in the future (9-11 hours here). Then using the file later should set it to the current time without waiting until the future time is reached. > Below is the updated patch. I also added a comment to devfs_timestamp(), > please reformulate it to your liking. I like this version. Bruce