Received: by 10.213.65.68 with SMTP id h4csp104358imn; Thu, 15 Mar 2018 10:53:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELsM/AEUqB5CUPsO3ClZQ6hZUlpuECsVeVW4RC2qJnh4Ati76fnu3/B+u4jxFOI5MDud0o9d X-Received: by 10.99.96.84 with SMTP id u81mr7364699pgb.231.1521136398075; Thu, 15 Mar 2018 10:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521136398; cv=none; d=google.com; s=arc-20160816; b=J8TQOv0M6i5EkACP4q2DUnOzoTOcGeFT8eHl8MkCRk18RVrP6mRoATH6oEV9ngoD0W zhAIvdOFBbNexZNrgIjtiTJoR12QsQgKdkNUgflDO+tqUC0uoV4CwHnze+LQB1seoHhu Az0t+phkxvzXM6xPuOl1Um2q49l6WPjvj901MY7Ryeqwj1AG3IGl3NQTBeCVvDEKDFge ZKCFZrWbiypvBbRC+fkPo/q6poBa/5PiO8XdJe8j6uQpxlW1OxRJtsqjseapAZCKykXQ /a+hQBaEW6YDePtiCODle71kuMDp8PB+f5MMGi3o0xEc2CfOXJWYQrNG3LslHhETnX8h duag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=yvgPj7dGA5r3+rbOvEXiDtouSWSsjYeZFvu4OCxjP60=; b=uSuhPFYwb393Aay9+feLIj9CAQ96CuM08/NzIkTU8V2V2TEALMx5TQMYV/GhCI+9sF gtfHHnpKRDa8UQAzj1mPJYrjRlKWZfr8Vn9KRAizAQiSPB9iMdnezr6jEbGDqX2nIgXX YCfCDOy+oED4kxltuIrzwHUnAsPNX+qJFkj3wu8JufbZTJtpjoxmIyRN03vincM6wG8v lY6jU/zHm6aLp26zBnJbEE0RDzqHKCIhxE18Hl9iA1K8/jJ8J+tH2tZCDEFA1UZ5GzkI QgHeDbfVcpS8Li+aUe/syHvvf19qId5e6YDzJZPB6OGeTJ+owV1/IawgBlLDvG9eJH1z H6Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=QLNfGA+U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si3724842pge.715.2018.03.15.10.53.03; Thu, 15 Mar 2018 10:53:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@eng.ucsd.edu header.s=google header.b=QLNfGA+U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752587AbeCORvu (ORCPT + 99 others); Thu, 15 Mar 2018 13:51:50 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:53147 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbeCORvs (ORCPT ); Thu, 15 Mar 2018 13:51:48 -0400 Received: by mail-it0-f66.google.com with SMTP id k135-v6so10158100ite.2 for ; Thu, 15 Mar 2018 10:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eng.ucsd.edu; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yvgPj7dGA5r3+rbOvEXiDtouSWSsjYeZFvu4OCxjP60=; b=QLNfGA+UP4gwHkQpXKJXSG7TIj/UjwHrB0ebVzIXnky+dqByitjBlg61ScmcWPmZb4 uIa0pOvc1P9WsRMIewM3KfCN/aQum3bWn9qBXDWvRlrMke90vaaV1D7DhLX2Rxui/25c 5CU/ukgvZxJab60WPXmclhkP7+ugRMmQdm+HQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yvgPj7dGA5r3+rbOvEXiDtouSWSsjYeZFvu4OCxjP60=; b=fE+CR3fG52XTcfTrOcKlLMa9Ts1HGn4C3CPO6/d1JBnD/PvyVKyTDAJBYF1npCHC/F AAFdWL6Ggeks7FsmaiGUGskHKA/iHN5zNdex8hpf5kPH+JH2qiVvMBHU266OKj4TJZqN qc6T193E3t0MoyPrOIWAlublKPtXggzaA1crZx/0+EDLysMPCv5rdKP8P8mlpKD9qhQJ HaO1HOZB5yf7Kor03ZSXzMc+0JkGXFuzdmUahW8Row7SeJtOFDagoDk5Ih1C4VsiEfHa bB7UM0rNo6rKzzA7Wvct8EFbuEFiXGvg7cgC/ZeM1+l2tmhOlKTap6c5Pahj25e3LJAJ yCRQ== X-Gm-Message-State: AElRT7E3DoLJEjLXOi1+78ygVdKVYKsdcddZd2+ehvXXa2iP+Yfsb4Jt ed5kga97ZNvOPhMAQZWZPBMNdvb+9fXVBc0ouMpI/A== X-Received: by 10.36.34.194 with SMTP id o185mr7568329ito.60.1521136307850; Thu, 15 Mar 2018 10:51:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.195.72 with HTTP; Thu, 15 Mar 2018 10:51:46 -0700 (PDT) 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: Andiry Xu Date: Thu, 15 Mar 2018 10:51:46 -0700 Message-ID: Subject: Re: [RFC v2 03/83] Add super.h. To: Arnd Bergmann Cc: "Darrick J. Wong" , Linux FS Devel , Linux Kernel Mailing List , "linux-nvdimm@lists.01.org" , Dan Williams , "Rudoff, Andy" , coughlan@redhat.com, Steven Swanson , Dave Chinner , Jan Kara , swhiteho@redhat.com, miklos@szeredi.hu, Jian Xu , Andiry Xu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 2:05 AM, Arnd Bergmann wrote: > 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. > I will take a look at other file systems. Superblock mtime is not a big problem as it is updated rarely. 64-bit seconds and 32-bit nanoseconds make the inode and log entry bigger, and updating file->atime cannot be done with a single 64bit update. That may be annoying and needs to use journaling. Thanks, Andiry > Arnd