From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6543B20956085 for ; Thu, 15 Mar 2018 01:58:38 -0700 (PDT) Received: by mail-it0-x241.google.com with SMTP id z7-v6so6231756iti.1 for ; Thu, 15 Mar 2018 02:05:02 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1520705944-6723-1-git-send-email-jix024@eng.ucsd.edu> <1520705944-6723-4-git-send-email-jix024@eng.ucsd.edu> <20180315045401.GB4860@magnolia> From: Arnd Bergmann Date: Thu, 15 Mar 2018 10:05:00 +0100 Message-ID: Subject: Re: [RFC v2 03/83] Add super.h. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Andiry Xu Cc: coughlan@redhat.com, "linux-nvdimm@lists.01.org" , Andiry Xu , "Darrick J. Wong" , Dave Chinner , Linux Kernel Mailing List , miklos@szeredi.hu, Jan Kara , Linux FS Devel , Steven Swanson , swhiteho@redhat.com, Jian Xu List-ID: On Thu, Mar 15, 2018 at 7:11 AM, Andiry Xu wrote: > On Wed, Mar 14, 2018 at 9:54 PM, Darrick J. Wong > wrote: >> On Sat, Mar 10, 2018 at 10:17:44AM -0800, Andiry Xu wrote: >>> + /* s_mtime and s_wtime should be together and their order should not be >>> + * changed. we use an 8 byte write to update both of them atomically >>> + */ >>> + __le32 s_mtime; /* mount time */ >>> + __le32 s_wtime; /* write time */ >> >> Hmmm, 32-bit timestamps? 2038 isn't that far away... >> > > I will try fixing this in the next version. I would also recommend adding nanosecond-resolution timestamps. In theory, a signed 64-bit nanosecond field is sufficient for each timestamp (it's good for several hundred years), but the more common format uses 64-bit seconds and 32-bit nanoseconds in other file systems. Unfortunately it looks, you will have to come up with a more sophisticated update method above, even if you leave out the nanoseconds, you can't easily rely on a 16-byte atomic update across architectures to deal with the two 64-bit timestamps. For the superblock fields, you might be able to get away with using second resolution, and then encoding the timestamps as a signed 64-bit 'mkfs time' along with two unsigned 32-bit times added on top, which gives you a range of 136 years mount a file system after its creation. Arnd _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm