From: Arnd Bergmann <arnd@arndb.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: y2038@lists.linaro.org, Deepa Dinamani <deepa.kernel@gmail.com>,
linux-fsdevel@vger.kernel.org, david@fromorbit.com,
' Theodore Ts'''o <tytso@mit.edu>,
linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk
Subject: Re: [Y2038] [RFC v2] vfs 64 bit time transition proposals
Date: Wed, 24 Feb 2016 14:56:16 +0100 [thread overview]
Message-ID: <2433031.kYHJ1ECYja@wuerfel> (raw)
In-Reply-To: <alpine.DEB.2.11.1602241223530.3670@nanos>
On Wednesday 24 February 2016 13:19:07 Thomas Gleixner wrote:
> On Fri, 12 Feb 2016, Arnd Bergmann wrote:
> > 2b has the main advantage of not changing behavior with the flip, so
> > we can convert all file systems to use vfs_time relatively easily
> > and then later make them actually use 64-bit timestamps with
> > a patch that each file system developer can do for themselves.
>
> And that's a very clear advantage of this approch. The change is purely
> mechanical and can be largely done with coccinelle.
Actually Deepa pointed out one common case where the behavior actually
changes:
inode->i_mtime.tv_sec = le32_to_cpu(on_disk_mtime);
will change behavior when tv_sec is changed to a time64_t, but
it only changes in a way that is consistent with 64-bit architectures,
and it will not change for user space that uses the existing syscalls
to actually read the timestamps, so the risk of introducing a regression
here is still really low.
> > One downside is that it leads to rather ugly code as discussed
> > before, examples are in "[RFC v2b 5/5] fs: xfs: change inode
> > times to use vfs_time data type" and "[RFC v2b 3/5] fs: btrfs:
> > Use vfs_time accessors".
>
> - now = current_fs_time(inode->i_sb);
> - if (!timespec_equal(&inode->i_mtime, &now))
> - inode->i_mtime = now;
> + now = vfs_time_to_timespec(current_fs_time(inode->i_sb));
> + ts = vfs_time_to_timespec(inode->i_mtime);
> + if (!timespec_equal(&ts, &now))
> + inode->i_mtime = timespec_to_vfs_time(now);
> +
> + ts = vfs_time_to_timespec(inode->i_mtime);
> + if (!timespec_equal(&ts, &now))
> + inode->i_ctime = timespec_to_vfs_time(now);
>
> You can either provide a helper function which does that m/c_time update at
> the VFS level where you can hide the mess or just accept that this transition
> will introduce some odd constructs like the above.
I think we can live with this. There are around 10 files that do
timespec_compare() or timespec_equal(), comparing an inode timestamp
with a local variable or a filesystem specific timespec value,
but they are all slightly different so there is no obvious
helper function to address multiple file systems at once
without also introducing a 'struct vfs_time'.
> > 2c gets us the furthest along the way for the conversion, close
> > to where we want to end up in the long run, so we could do that
> > to file systems one by one. The behavior change is immediate,
> > so there are fewer possible surprises than with 2a, but it
> > also means the most upfront work.
>
> I would'nt worry about the upfront work to much, if it is the cleanest way to
> do the conversion. Though, I'm not seing how that really makes the whole thing
> simpler.
>
> So far we had good results with changing core code first and then fix up the
> users one by one and at the end remove any intermediary helpers which we
> introduced along the way. So I'd chose 2b as it's a very clear transition
> mechanism with pretty low risk.
Ok, thanks for your input, let's do that then.
I'd like to get the preparation patch ([RFC v2b 1/5] vfs: Add vfs_time accessors)
merged as soon as possible so we can do the rest of the series through
the file system maintainer trees where possible.
I guess even though the patch by itself is trivial, it's now too late to
do for 4.5, but we should be able to just put that into your tip tree,
or Al's vfs tree for 4.6 and then try to get all file systems moved over
for 4.7, followed by the vfs patch to actually change the type.
Arnd
prev parent reply other threads:[~2016-02-24 13:56 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 9:21 [RFC v2] vfs 64 bit time transition proposals Deepa Dinamani
2016-02-12 9:35 ` [RFC v2a 00/12] vfs 64 bit time transition proposal Deepa Dinamani
2016-02-12 9:35 ` [RFC v2a 01/12] vfs: Add vfs_time abstractions Deepa Dinamani
2016-02-12 9:35 ` [RFC v2a 02/12] fs: cifs: Change cifs_fscache_inode_auxdata to use vfs_time data type Deepa Dinamani
2016-02-12 9:35 ` [RFC v2a 03/12] fs: cifs: Change cifs_fattr timestamps data type to vfs_time Deepa Dinamani
2016-02-12 9:35 ` [RFC v2a 04/12] fs: cifs: Make cnvrtDosUnixTm() y2038 safe Deepa Dinamani
2016-02-12 9:35 ` [RFC v2a 05/12] fs: cifs: Use vfs_time_get_real_* time functions Deepa Dinamani
2016-02-12 9:36 ` [RFC v2a 06/12] fs: btrfs: Change btrfs_inode.i_otime to use vfs_time data type Deepa Dinamani
2016-02-12 9:36 ` [RFC v2a 07/12] fs: btrfs: Use vfs_time data type for btrfs_update_time() Deepa Dinamani
2016-02-12 9:36 ` [RFC v2a 08/12] fs: btrfs: Change timespec data types to use vfs_time Deepa Dinamani
2016-02-12 9:36 ` [RFC v2a 09/12] fs: ceph: Change encode and decode functions " Deepa Dinamani
2016-02-12 9:36 ` [RFC v2a 10/12] fs: ceph: Replace timespec data type with vfs_time Deepa Dinamani
2016-02-12 9:36 ` [RFC v2a 11/12] net: ceph: use vfs_time data type instead of timespec Deepa Dinamani
2016-02-13 22:08 ` Dave Chinner
2016-02-14 1:46 ` Deepa Dinamani
2016-02-14 2:05 ` Deepa Dinamani
2016-02-14 21:00 ` Dave Chinner
2016-02-17 9:32 ` Arnd Bergmann
2016-02-12 9:36 ` [RFC v2a 12/12] fs: xfs: change inode times to use vfs_time data type Deepa Dinamani
2016-02-12 9:45 ` [RFC v2b 0/5] vfs 64 bit time transition proposal Deepa Dinamani
2016-02-12 9:45 ` [RFC v2b 1/5] vfs: Add vfs_time accessors Deepa Dinamani
2016-02-12 9:45 ` [RFC v2b 2/5] fs: cifs: Use " Deepa Dinamani
2016-02-12 9:45 ` [RFC v2b 3/5] fs: btrfs: " Deepa Dinamani
2016-02-12 13:57 ` Arnd Bergmann
2016-02-13 7:01 ` Deepa Dinamani
2016-02-12 9:45 ` [RFC v2b 4/5] fs: ceph: Use vfs timestamp accessors Deepa Dinamani
2016-02-12 9:45 ` [RFC v2b 5/5] fs: xfs: change inode times to use vfs_time data type Deepa Dinamani
2016-02-13 2:18 ` Dave Chinner
2016-02-13 14:50 ` [Y2038] " Arnd Bergmann
2016-02-12 9:52 ` [RFC v2c 0/8] vfs 64 bit time transition proposal Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 1/8] vfs: Add vfs_time abstractions Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 2/8] fs: cifs: Change auxdata to struct timespec64 data type Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 3/8] fs: cifs: Change cifs_fattr timestamps data type to timespec64 Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 4/8] fs: cifs: Make cnvrtDosUnixTm() y2038 safe Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 5/8] fs: btrfs: Change btrfs_inode.i_otime to vfs_time data type Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 6/8] fs: btrfs: Use vfs timestamp abstraction helper Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 7/8] fs: ceph: Use vfs timestamp abstraction helpers Deepa Dinamani
2016-02-12 9:52 ` [RFC v2c 8/8] fs: xfs: change inode times to use vfs_time data type Deepa Dinamani
2016-02-12 14:03 ` [Y2038] [RFC v2] vfs 64 bit time transition proposals Arnd Bergmann
2016-02-13 6:58 ` Deepa Dinamani
2016-02-13 11:50 ` Deepa Dinamani
2016-02-13 11:54 ` Deepa Dinamani
2016-02-24 12:19 ` [Y2038] " Thomas Gleixner
2016-02-24 12:26 ` Julia Lawall
2016-02-24 13:56 ` 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=2433031.kYHJ1ECYja@wuerfel \
--to=arnd@arndb.de \
--cc=david@fromorbit.com \
--cc=deepa.kernel@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tytso@mit.edu \
--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;
as well as URLs for NNTP newsgroup(s).