Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933241AbdCaMfb (ORCPT ); Fri, 31 Mar 2017 08:35:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54080 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932927AbdCaMf3 (ORCPT ); Fri, 31 Mar 2017 08:35:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8B34F624AB Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=rpeterso@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8B34F624AB Date: Fri, 31 Mar 2017 08:35:27 -0400 (EDT) From: Bob Peterson To: Linus Torvalds Cc: David Howells , Thomas Gleixner , John Stultz , Linux Kernel Mailing List , linux-fsdevel Message-ID: <862670400.9739334.1490963727025.JavaMail.zimbra@redhat.com> In-Reply-To: References: <22214.1490895007@warthog.procyon.org.uk> <23410.1490902528@warthog.procyon.org.uk> <23902.1490904827@warthog.procyon.org.uk> Subject: Re: Apparent backward time travel in timestamps on file creation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.64.2] Thread-Topic: Apparent backward time travel in timestamps on file creation Thread-Index: fg0U/ZDZ0DUBpPbieS85dWTh93ab6Q== X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 31 Mar 2017 12:35:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2094 Lines: 46 ----- Original Message ----- | On Thu, Mar 30, 2017 at 1:13 PM, David Howells wrote: | > Linus Torvalds wrote: | > | >> The error bar can be huge, for the simple reason that the filesystem | >> you are testing may not be sharing a clock with the CPU at _all_. | >> | >> IOW, think network filesystems. | > | > Can't I just not do the tests when the filesystem is a network fs? I don't | > think it should be a problem for disk filesystems on network-attached | > storage. | | So I actually think that the whole "check timestamps" would be | interesting as a test across a lot of filesystems - including very | much network filesystems - but I think such a test should be largely | informational rather than about correctness. | | Now, there definitely are correctness issues too wrt file timestamps | (ie the whole "writes should update mtime" kind of testing), and I | think many of those cound be extended to check relative timestamps on | the same filesystem. For example, if you write to file A first, and to | file B second, it would certainly be odd and interesting if file B now | has a modification time that is before file A. This can happen, and it's not just network file systems. This issue is also a concern of GFS2 where we have shared storage. We like to think ntp will keep things relatively sane, but still, we've had issues in the past where time discrepancies have caused confusion: File X is created on node 1, but due to clock drift, node 2 sees that file as having been created in the future, etc. It's even more worrisome outside the kernel where software (e.g. in the past, parts of the cluster infrastructure) would calculate negative time values, interpret them as an "nearly infinite amount of time" having passed, and then various watchdogs nuking nodes. I remember a long time ago someone was up in arms because of weird effects they were seeing, and it boiled down to not using any time sync and one of their cluster nodes had the wrong month, or some such. Regards, Bob Peterson Red Hat File Systems