public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Steve French <smfrench@gmail.com>
Cc: y2038@lists.linaro.org, Dave Chinner <david@fromorbit.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Deepa Dinamani <deepa.kernel@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [Y2038] [PATCH] vfs: Add support to check max and min inode times
Date: Fri, 04 Mar 2016 17:21:52 +0100	[thread overview]
Message-ID: <2036084.gnLX4sX4mL@wuerfel> (raw)
In-Reply-To: <CAH2r5msnyOzV4Pb8FC40tene6XZioVsAjMtfS1Kb0HgShBtBuA@mail.gmail.com>

On Friday 04 March 2016 00:31:09 Steve French wrote:
> >> i.e. 32 bit systems should default to 32 bit time limits until the
> >> filesystem developers come along and verify that conversion from
> >> their on-disk format to 64 bit time works correctly. Then they set
> >> their real limits which may (or may not) be >y2038 compatible, and
> >> this means that filesystems that have not been converted to >y2038
> >> compatible do not need any modifications to behave correctly on 32
> >> bit systems...
> >
> > We can set the limits in the superblock if you like, but I would
> > not do it by changing the constants here:
> >
> > Most file systems have arbitrary other maximum dates that they
> > need to set (on 64-bit systems), e.g. 2028 (iso9660), 2040 (hfsplus),
> > 2106 (ceph), 2107 (fat, cifs), 2262 (logfs), 2514 (ext4).
> 
> I am puzzled why 2107 would be the maximum date for cifs.  My
> calculation comes to a
> maximum date of approximately the year 60,000AD for 64 bit DCE time
> (cifs.ko gets DCE time back in all time fields when using CIFS, SMB2 or SMB3
> except for the oldest dialects of CIFS).   DCE time is
> 100 nanoseconds since 1601 - see the definition of FILETIME in section 2.3.3
> of https://msdn.microsoft.com/en-us/library/cc230324.aspx).  And shouldn't
> this be the same for NTFS as they use a similar DCE time internally?
> 

The value I was looking up in my table at http://kernelnewbies.org/y2038
indeed referred to the ancient SMB timestamps that use a 7-bit year
number starting in 1980, just as fat has.

The year I have listed in the table for modern cifs and ntfs is 30328,
which assumes that it's a signed 64-bit multiple of 100 nanoseconds, and
that's what I see in cifs_NTtimeToUnix() as well. The documentation
you point to describes it as unsigned, which matches your 60,000AD
date, so before we add the limits, we should try to clarify which one
was intended.

	Arnd

      reply	other threads:[~2016-03-04 16:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 15:51 [PATCH] vfs: Add support to check max and min inode times Deepa Dinamani
2016-03-02 16:26 ` [Y2038] " Arnd Bergmann
2016-03-02 22:19 ` Dave Chinner
2016-03-02 23:07   ` Arnd Bergmann
2016-03-02 23:45     ` Dave Chinner
2016-03-03  6:24       ` Deepa Dinamani
2016-03-03 14:08       ` [Y2038] " Arnd Bergmann
2016-03-04  1:10         ` Dave Chinner
2016-03-04  7:49           ` Deepa Dinamani
2016-03-04 16:54           ` Arnd Bergmann
2016-03-04  6:31         ` Steve French
2016-03-04 16:21           ` Arnd Bergmann [this message]

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=2036084.gnLX4sX4mL@wuerfel \
    --to=arnd@arndb.de \
    --cc=david@fromorbit.com \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=smfrench@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.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