public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@gnu.org>
To: Andi Kleen <ak@suse.de>
Cc: gcc@gcc.gnu.org, linux-kernel@vger.kernel.org, bug-coreutils@gnu.org
Subject: Re: Linux 2.6 nanosecond time stamp weirdness breaks GCC build
Date: Thu, 01 Apr 2004 16:35:20 -0800	[thread overview]
Message-ID: <7w3c7nb4jb.fsf@sic.twinsun.com> (raw)
In-Reply-To: 20040401220957.5f4f9ad2.ak@suse.de

On Thu, Apr 01, 2004 at 10:09:57PM +0200, Andi Kleen wrote:

> just round up to the next second instead of rounding down when going
> from 1s resolution to ns.

Please don't do that.  Longstanding tradition in timestamp code is to
truncate toward minus infinity when converting from a
higher-resolution timestamp to a lower-resolution timestamp.  This
is consistent behavior, and is easy to explain: let's stick to it as a
uniform practice.

There are two basic principles here.  First, ordinary files should not
change spontaneously: hence a file's timestamp should not change
merely because its inode is no longer cached.  Second, a file's
timestamp should never be "in the future": hence one should never
round such timestamps up.

The only way I can see to satisfy these two principles is to truncate
the timestamp right away, when it is first put into the inode cache.
That way, the copy in main memory equals what will be put onto disk.
This is the approach taken by other operating systems like Solaris,
and it explains why parallel GCC builds won't have this problem on
these other systems.

Switching subjects slightly, in
<http://mail.gnu.org/archive/html/bug-coreutils/2004-03/msg00095.html>
I recently contributed code to coreutils that fixes some bugs with "cp
--update" and "mv --update" when files are copied from
high-resolution-timestamp file systems to low-resolution-timestamp
file systems.  This code dynamically determines the timestamp
resolution of a file system by examining (and possibly mutating) its
timestamps.  The current Linux+ext3 behavior (which I did not know
about) breaks this code, because it can cause "cp" to falsely think
that ext3 has nanosecond-resolution timestamps.

How long has the current Linux+ext3 behavior been in place?  If it's
widespread, I'll probably have to think about adding a workaround to
coreutils.  Does the behavior affect all Linux filesystems, or just
ext3?

I'll CC: this message to bug-coreutils to give them a heads-up.

  parent reply	other threads:[~2004-04-02  0:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-01 19:28 Linux 2.6 nanosecond time stamp weirdness breaks GCC build Ulrich Weigand
2004-04-01 20:09 ` Andi Kleen
2004-04-01 20:39   ` Daniel Jacobowitz
2004-04-01 20:46     ` Andi Kleen
2004-04-01 21:01       ` Ulrich Weigand
2004-04-01 21:44         ` Andi Kleen
2004-04-01 22:39     ` Joe Buck
2004-04-01 22:44       ` Paul Jarc
2004-04-01 22:48       ` Ulrich Weigand
2004-04-01 23:58         ` Joe Buck
2004-04-02  0:13           ` Daniel Jacobowitz
2004-04-02  0:02   ` Jamie Lokier
2004-04-02  0:35   ` Paul Eggert [this message]
2004-04-02  1:14     ` Jamie Lokier
2004-04-02  7:57       ` James H. Cloos Jr.
2004-04-02  9:22       ` Paul Eggert
2004-04-02 16:23         ` Jamie Lokier
2004-04-02 20:45           ` Paul Eggert
2004-04-02 21:07             ` Jamie Lokier
2004-04-02 21:56               ` Paul Eggert
2004-04-03  4:59       ` Andrew Pimlott
2004-04-02  0:37   ` Andrew Morton
2004-06-07 16:03     ` Jörn Engel
2004-04-01 21:13 ` Janis Johnson
2004-04-01 21:41   ` Ulrich Weigand
2004-04-02  0:30   ` Alan Modra
2004-04-02  9:05 ` P
2004-04-02 17:27 ` Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2004-04-01 20:51 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7w3c7nb4jb.fsf@sic.twinsun.com \
    --to=eggert@gnu.org \
    --cc=ak@suse.de \
    --cc=bug-coreutils@gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox