Introduction
This is a follow on to the series: https://lkml.org/lkml/2016/1/7/20 [1].
This is aimed at reaching a consensus on how to transition the vfs
timestamps to use 64 bit time. This demonstrates three ways (2a, 2b and
2c) of solving this problem. Each of the proposals has its own cover
letter that explains the individual approach. Proposals 2b and 2c also
outline variant approaches which are similar to the respective proposals.
This drives the proposal count to 5. All the changes have been discussed
with Arnd Bergmann, who posted the original series:
https://lkml.org/lkml/2014/5/30/669 [2]
The series has been simplified to include only the 64 bit timestamp
changes as per Dave Chinner’s suggestion.
Motivation
The problem is how to change the vfs inode timestamps to use 64 bit
times to overcome the 2038 problem.
Below table [3] gives an overview of the extent/ type of changes
needed of changes needed.
The series is aimed at obtaining small manageable patches for all
the cases in [3].
Table [3]
Terminology: vfs_time – data type of timestamps used in the vfs layer.
Access type # of instances
1. timespec_*(struct vfs_time, struct timespec) / 34
timespec_*(struct vfs_time, struct vfs_time)
2. struct vfs_time = struct vfs_time 50
3. vfs_time = current_fs_time/ CURRENT_TIME/ CURRENT_TIME_SEC 312
4. setattr vfs_time assignments 141
5. vfs_time = other data types, outside of setattr() (timespec, s32, s64..) 74
6. other data types, outside of getattr() (timespec, s32, s64..) = vfs_time 85
7. internal individual fs funtions using inode timestamps as args 80
8. extra timestamp fields in individual filesystems ~10
9. VFS callback - int (*update_time)(struct inode *, struct timespec *, int) 3
10. VFS function - void lease_get_mtime(struct inode *inode, struct timespec *time) 3
Each series is used to demonstrate how each of the above cases is solved
using their respective approaches. The example filesystems (btrfs,
xfs, cifs, and ceph) were selected in such a way so as to showcase all
these issues in table [3].
Source Tree
The tree is hosted at github.com/deepa-hub/vfs.git
The branches for the three approaches are
2a. https://github.com/deepa-hub/vfs.git refs/heads/vfs_time
2b. https://github.com/deepa-hub/vfs.git refs/heads/vfs_time_to_timespec
2c. https://github.com/deepa-hub/vfs.git refs/heads/vfs_time_to_ts64
All the above series are based off of:
https://lkml.org/lkml/2016/2/3/34 [4]
and a couple of other patches.
Only the minimal changes are posted here to keep the series simple.
There are a couple of bug fixes like data type conversion bugs that will
be sent directly to the corresponding filesystem lists.
Next steps
The approaches 2a, 2b and 2c are posted as responses to this cover letter.
Testing
All the approaches have been compile tested only.
Arnd,
This one I've had no response.
Shall I just do RESEND to maintainers?
I don't see a special tree listed in the maintainers file so is it ok
that I built this on staging-testing?
If I need to rebase it, is it a RESEND or a new send. Does that
question make sense?
Thanks,
alisons
----- Forwarded message from Alison Schofield <amsfield22(a)gmail.com> -----
Date: Mon, 4 Jan 2016 11:12:24 -0800
From: Alison Schofield <amsfield22(a)gmail.com>
To: jbottomley(a)odin.com
Subject: gdth reviewer/maintainer ?
User-Agent: Mutt/1.5.23 (2014-03-12)
James,
email to Achim is bouncing. Is there another reviewer I should send
this patch to? (Arnd has reviewed for y2038 group)
Thanks,
Alison
----- Forwarded message from Alison Schofield <amsfield22(a)gmail.com> -----
Date: Tue, 24 Nov 2015 16:44:07 -0800
From: Alison Schofield <amsfield22(a)gmail.com>
To: achim_leubner(a)adaptec.com, JBottomley(a)odin.com, linux-scsi(a)vger.kernel.org,
linux-kernel(a)vger.kernel.org, y2038(a)lists.linaro.org
Subject: [PATCH v2] scsi: gdth: replace struct timeval with
ktime_get_real_seconds()
X-Mailer: git-send-email 2.1.4
struct timeval will overflow on 32-bit systems in y2038 and is being
removed from the kernel. Replace the use of struct timeval and
----- Forwarded message from David Miller <davem(a)davemloft.net> -----
Date: Sun, 17 Jan 2016 19:27:17 -0500 (EST)
From: David Miller <davem(a)davemloft.net>
To: amsfield22(a)gmail.com
Cc: mac(a)melware.de, isdn(a)linux-pingi.de, netdev(a)vger.kernel.org,
linux-kernel(a)vger.kernel.org, y2038(a)lists.linaro.org
Subject: Re: [PATCH v3] isdn: divamnt: use y2038-safe ktime_get_ts64() for
trace data timestamps
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
From: Alison Schofield <amsfield22(a)gmail.com>
Date: Fri, 15 Jan 2016 08:51:25 -0800
> divamnt stores a start_time at module init and uses it to calculate
> elapsed time. The elapsed time, stored in secs and usecs, is part of
...............snip
>
> Signed-off-by: Alison Schofield <amsfield22(a)gmail.com>
> Reviewed-by: Arnd Bergmann <arnd(a)arndb.de>
Please resubmit this when the net-next tree is open again.
Thank you.
----- End forwarded message -----
Arnd,
How do I know when the net-next tree is open?
And, I guess I need to rebase this on the net-next tree before I resend
- right?
Thanks!
Alison
Hi,
I was just going through your website and I see that your company is dealing
with open source software
So, would you be interested to acquire a list of Canonical and Ubuntu End
Users for your marketing initiatives.
We can also help you with the users' database of:
. Redhat
. Linux.
. Centos
. Mint
. Windows and more.
Information fields: Contact First Name, Last Name, Job Title, Email Address,
Phone Number, Fax Number, Company Name, Company Physical Address, and
Company Web Address, SIC Code, NAICS code, Primary Industry, Employee Size,
Revenue, Technology Type
Let me know if you are focused on any particular titles and application
users so that I can get back to you with all the relevant details.
Thank you & look forward to hearing from you.
Regards,
Tania Cuevas - Sr. Marketing Executive
___________________________________________________________________________
We respect your privacy. If you do not wish to receive future e-mail please
reply with "REMOVE
This patch replaces timeval with timespec64 as 32 bit 'struct timeval'
will not give current time beyond year 2038.
The patch changes the code to use ktime_get_real_ts64() which returns
a 'struct timespec64' instead of do_gettimeofday() which returns a
'struct timeval'
This patch also alters the format strings in sprintf() for now.tv_sec
and now.tv_nsec to incorporate 'long long' on 32 bit architectures and
leading zeroes respectively.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606(a)gmail.com>
Reviewed-by: Arnd Bergmann <arnd(a)arndb.de>
---
Changes in v2:
-change format string of now.tv_sec to '%llu'
-change format string of now.tv_nsec to '%.08lu'
Changes in v3:
-Replace tv_usec with tv_nsec, error made in v2
-Build tested
Changes in v4:
-Removed checkpatch.pl errors
drivers/misc/ibmasm/ibmasm.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 9b08344..25be44e 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -34,6 +34,7 @@
#include <linux/kref.h>
#include <linux/device.h>
#include <linux/input.h>
+#include <linux/time64.h>
/* Driver identification */
#define DRIVER_NAME "ibmasm"
@@ -53,9 +54,11 @@ extern int ibmasm_debug;
static inline char *get_timestamp(char *buf)
{
- struct timeval now;
- do_gettimeofday(&now);
- sprintf(buf, "%lu.%lu", now.tv_sec, now.tv_usec);
+ struct timespec64 now;
+
+ ktime_get_real_ts64(&now);
+ sprintf(buf, "%llu.%.08lu", (long long)now.tv_sec,
+ now.tv_nsec / NSEC_PER_USEC);
return buf;
}
--
1.9.1