From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC 11/32] xfs: convert to struct inode_time Date: Mon, 02 Jun 2014 20:52:43 +0200 Message-ID: <5109660.teHoOW5tSd@wuerfel> References: <1401480116-1973111-1-git-send-email-arnd@arndb.de> <4178301.j9kWdGCRLC@wuerfel> <6868F108-F0B2-423F-AE31-90DF86A5B7DD@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <6868F108-F0B2-423F-AE31-90DF86A5B7DD@oracle.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Chuck Lever Cc: Nicolas Pitre , linux-arch@vger.kernel.org, Linux NFS Mailing List , LKML Kernel , lftan@altera.com, Christoph Hellwig , john.stultz@linaro.org, "H. Peter Anvin" , linux-fsdevel , geert@linux-m68k.org, tglx@linutronix.de, xfs@oss.sgi.com, joseph@codesourcery.com List-Id: linux-arch.vger.kernel.org T24gTW9uZGF5IDAyIEp1bmUgMjAxNCAxMTowNDoyMyBDaHVjayBMZXZlciB3cm90ZToKPiBJ4oCZ bSB3b25kZXJpbmcgd2hhdCBzaG91bGQgYmUgZG9uZSBhYm91dCBORlMuIEEgc29sdXRpb24gZm9y IE5GUyBzaG91bGQKPiBtYXRjaCBhbnkgc2NoZW1lIHRoYXQgaXMgY29uc2lkZXJlZCBmb3IgbG9j YWwgZmlsZSBzeXN0ZW1zLCBJTU8uCj4gCj4gTkZTdjIvMyB0aW1lc3RhbXBzIGFyZSBhIHBhaXIg b2YgdW5zaWduZWQgMzItYml0IHZhbHVlczogb25lIHZhbHVlIGZvcgo+IHNlY29uZHMgc2luY2Ug bWlkbmlnaHQgR01UIEphbiAxLCAxOTcwLCBhbmQgb25lIHZhbHVlIGZvciBuYW5vc2Vjb25kcy4K PiAoU2VlIHRoZSBkZWZpbml0aW9uIG9mIG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VGhpcyBiZWhhdmlvciBpcyBjbGVhcmx5IHdyb25nLCBidXQg aXQncyB0aGUgc2FtZSBidWcgdGhhdCB3ZSBoYXZlCmluIGxvdHMgb2Ygb3RoZXIgZmlsZSBzeXN0 ZW1zLCBhbmQgaXQgbWFrZXMgc2Vuc2UgdG8gaGF2ZSB0aGUKc2FtZSBmaXggZXZlcnl3aGVyZSwg YXQgbGVhc2UgdGhlIGNhc2VzIHdoZXJlIHdlIGtub3cgd2hhdCBpbnRlcnByZXRhdGlvbgp3ZSBh Y3R1YWxseSB3YW50LiBORlMgaGFzIHRoZSBsdXh1cnkgb2YgaGF2aW5nIGFuIGFjdHVhbCBzcGVj aWZpY2F0aW9uCnNheWluZyB0aGF0IHRoZSB2YWx1ZSBpcyB1bnNpZ25lZC4gRm9yIG1vc3Qgb2Yg dGhlIGxlZ2FjeSBmaWxlIHN5c3RlbXMsCndlIGNhbiBvbmx5IG1ha2UgYSBndWVzcyBhdCBob3cg b3RoZXIgT1NzIHdvdWxkIGludGVycHJldCB0aGUgc2FtZQpudW1iZXJzLgoKCUFybmQKCl9fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCnhmcyBtYWlsaW5nIGxp c3QKeGZzQG9zcy5zZ2kuY29tCmh0dHA6Ly9vc3Muc2dpLmNvbS9tYWlsbWFuL2xpc3RpbmZvL3hm cwo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de ([212.227.17.24]:55760 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbaFBSwv convert rfc822-to-8bit (ORCPT ); Mon, 2 Jun 2014 14:52:51 -0400 From: Arnd Bergmann Subject: Re: [RFC 11/32] xfs: convert to struct inode_time Date: Mon, 02 Jun 2014 20:52:43 +0200 Message-ID: <5109660.teHoOW5tSd@wuerfel> In-Reply-To: <6868F108-F0B2-423F-AE31-90DF86A5B7DD@oracle.com> References: <1401480116-1973111-1-git-send-email-arnd@arndb.de> <4178301.j9kWdGCRLC@wuerfel> <6868F108-F0B2-423F-AE31-90DF86A5B7DD@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="utf-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Chuck Lever Cc: Nicolas Pitre , "H. Peter Anvin" , Dave Chinner , LKML Kernel , linux-arch@vger.kernel.org, joseph@codesourcery.com, john.stultz@linaro.org, Christoph Hellwig , tglx@linutronix.de, geert@linux-m68k.org, lftan@altera.com, linux-fsdevel , xfs@oss.sgi.com, Linux NFS Mailing List Message-ID: <20140602185243.VZVC30IjQhagY_cxhki6oUKlRl6abGKFQXuOrFoJjXg@z> On Monday 02 June 2014 11:04:23 Chuck Lever wrote: > I’m wondering what should be done about NFS. A solution for NFS should > match any scheme that is considered for local file systems, IMO. > > NFSv2/3 timestamps are a pair of unsigned 32-bit values: one value for > seconds since midnight GMT Jan 1, 1970, and one value for nanoseconds. > (See the definition of nfstime3 in RFC 1813). > > NFSv4 uses a signed 64-bit value where zero represents midnight UTC > on January 1, 1970, and an unsigned 32-bit value for nanoseconds. (See > the definition of nfstime4 in RFC 5661). > > The NFSv4 protocol is probably not problematic, and NFSv3 should be out > of the picture by 2038. But if changes are planned for dealing _now_ > with timestamp issues, compatibility with NFSv3 is a consideration. > > It is already the case that, via NFSv3, the Linux NFS client transmits > timestamps earlier than 1970 as large positive numbers. Try this with > xfstests generic/258. If I read the code correctly, a pre-1970 timestamp will be sent as a large unsigned integer, but received as a post-2038 timestamp on 64-bit kernels, both in the nfs client and server code. This behavior is clearly wrong, but it's the same bug that we have in lots of other file systems, and it makes sense to have the same fix everywhere, at lease the cases where we know what interpretation we actually want. NFS has the luxury of having an actual specification saying that the value is unsigned. For most of the legacy file systems, we can only make a guess at how other OSs would interpret the same numbers. Arnd