linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Deepa Dinamani <deepa.kernel@gmail.com>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>
Subject: Re: Files dated before 1970
Date: Sat, 20 Jun 2020 09:15:31 -0700	[thread overview]
Message-ID: <20200620161531.GE8681@bombadil.infradead.org> (raw)
In-Reply-To: <CAK8P3a1UOJa5499mZErTH6vHgLLJzr+R0EYbcbheSbjw0VqsHQ@mail.gmail.com>

On Sat, Jun 20, 2020 at 10:59:48AM +0200, Arnd Bergmann wrote:
> On Sat, Jun 20, 2020 at 4:16 AM Matthew Wilcox <willy@infradead.org> wrote:
> > le32_to_cpu() returns a u32.  Before your patch, the u32 was assigned
> > to an s32, so a file with a date stamp of 1968 would show up that way.
> > After your patch, the u32 is zero-extended to an s64, so a file from
> > 1968 now appears to be from 2104.
> 
> In the case of JFS, I think the change of behavior on 32-bit kernels was
> intended because it makes them do the same thing as 64-bit kernels.

Oh!  I hadn't realised that 64-bit kernels were already using a 64-bit
signed tv_sec.  That makes a world of difference.

> For JFS and the others that already used an unsigned interpretation
> on 64 bit kernels, the current code seems to be the least broken
> of the three alternatives we had:
> 
> a) as implemented in v4.18, change 32-bit kernels to behave the
>    way that 64-bit kernels always have behaved, given that 99% of
>    our users are on 64-bit kernels by now.
> 
> b) keep 32-bit and 64-bit kernels use a different interpretation,
>    staying compatible with older kernels but incompatible between
>    machines or between running the same user space on the
>    same machine in either native 32-bit mode or compat mode
>     a 64-bit kernel
> 
> c) change the 99% of users that have a 64-bit kernel to overflowing
>     the timestamps in y2038 because that was what the kernel
>     file system driver originally implemented on 32-bit machines
>     that no concept of post-y2038 time.

Yes, I agree, knowing more of the facts, this was the right decision to
make at the time, and I wouldn't change it now.  Thanks!

  reply	other threads:[~2020-06-20 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20  2:16 Files dated before 1970 Matthew Wilcox
2020-06-20  8:59 ` Arnd Bergmann
2020-06-20 16:15   ` Matthew Wilcox [this message]
2020-06-21 23:38     ` Deepa Dinamani
2020-06-21 23:36   ` Dave Chinner

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=20200620161531.GE8681@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).