Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-03 Thread Roger Willcocks
On Mon, 2014-06-02 at 19:32 -0400, Theodore Ts'o wrote: > Linux's time(2) can return (time_t) -1 and set errno to EFAULT, per > the Posix specification: > > SYSCALL_DEFINE1(time, time_t __user *, tloc) > { > time_t i = get_seconds(); > > if (tloc) { > if (put_user(i,tl

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-03 Thread Arnd Bergmann
On Tuesday 03 June 2014 18:41:30 Dave Chinner wrote: > On Tue, Jun 03, 2014 at 09:33:36AM +0200, Arnd Bergmann wrote: > > On Tuesday 03 June 2014 10:32:27 Dave Chinner wrote: > > > On Mon, Jun 02, 2014 at 01:43:44PM +0200, Arnd Bergmann wrote: > > > > On Monday 02 June 2014 10:28:22 Dave Chinner wr

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-03 Thread Dave Chinner
On Tue, Jun 03, 2014 at 09:33:36AM +0200, Arnd Bergmann wrote: > On Tuesday 03 June 2014 10:32:27 Dave Chinner wrote: > > On Mon, Jun 02, 2014 at 01:43:44PM +0200, Arnd Bergmann wrote: > > > On Monday 02 June 2014 10:28:22 Dave Chinner wrote: > > > > On Sun, Jun 01, 2014 at 10:24:37AM +1000, Dave C

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-03 Thread Arnd Bergmann
On Tuesday 03 June 2014 10:32:27 Dave Chinner wrote: > On Mon, Jun 02, 2014 at 01:43:44PM +0200, Arnd Bergmann wrote: > > On Monday 02 June 2014 10:28:22 Dave Chinner wrote: > > > On Sun, Jun 01, 2014 at 10:24:37AM +1000, Dave Chinner wrote: > > > > On Sat, May 31, 2014 at 05:37:52PM +0200, Arnd Be

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Dave Chinner
On Mon, Jun 02, 2014 at 01:43:44PM +0200, Arnd Bergmann wrote: > On Monday 02 June 2014 10:28:22 Dave Chinner wrote: > > On Sun, Jun 01, 2014 at 10:24:37AM +1000, Dave Chinner wrote: > > > On Sat, May 31, 2014 at 05:37:52PM +0200, Arnd Bergmann wrote: > > > > In my list at http://kernelnewbies.org/

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread H. Peter Anvin
On 06/02/2014 04:32 PM, Theodore Ts'o wrote: > On Mon, Jun 02, 2014 at 03:32:35PM -0700, H. Peter Anvin wrote: >> On 06/02/2014 03:29 PM, Theodore Ts'o wrote: >>> >>> And since we are already returning (time_t) -1 in some cases, we might >>> as well try to make things a bit more formal. >>> >> >> A

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Theodore Ts'o
On Mon, Jun 02, 2014 at 03:32:35PM -0700, H. Peter Anvin wrote: > On 06/02/2014 03:29 PM, Theodore Ts'o wrote: > > > > And since we are already returning (time_t) -1 in some cases, we might > > as well try to make things a bit more formal. > > > > Are we? I am not aware of *Linux* actually usin

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread H. Peter Anvin
On 06/02/2014 03:29 PM, Theodore Ts'o wrote: > > And since we are already returning (time_t) -1 in some cases, we might > as well try to make things a bit more formal. > Are we? I am not aware of *Linux* actually using that. -hpa -- To unsubscribe from this list: send the line "unsub

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Theodore Ts'o
On Mon, Jun 02, 2014 at 10:12:37AM -0700, H. Peter Anvin wrote: > > It would be problematic for time(2) or gettimeofday(2) to return > > TIME_UNDEFINED, since there are programs that care about time ticking > > forward, but I could imagine a new interface which would be permitted > > to return a fl

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 15:04:27 Chuck Lever wrote: > On Jun 2, 2014, at 2:58 PM, Roger Willcocks wrote: > > > > > On Mon, 2014-06-02 at 11:04 -0400, Chuck Lever wrote: > > > >> NFSv2/3 timestamps are a pair of unsigned 32-bit values: one value for > >> seconds since midnight GMT Jan 1, 1970, an

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Chuck Lever
On Jun 2, 2014, at 2:58 PM, Roger Willcocks wrote: > > On Mon, 2014-06-02 at 11:04 -0400, Chuck Lever wrote: > >> NFSv2/3 timestamps are a pair of unsigned 32-bit values: one value for >> seconds since midnight GMT Jan 1, 1970, and one value for nanoseconds. >> (See the definition of nfstime3

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Roger Willcocks
On Mon, 2014-06-02 at 11:04 -0400, Chuck Lever wrote: > NFSv2/3 timestamps are a pair of unsigned 32-bit values: one value for > seconds since midnight GMT Jan 1, 1970, and one value for nanoseconds. > (See the definition of nfstime3 in RFC 1813). > nfstime3 could be extended by redefining the

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 11:04:23 Chuck Lever wrote: > I’m wondering what should be done about NFS. A solution for NFS should > match any scheme that is considered for local file systems, IMO. > > NFSv2/3 timestamps are a pair of unsigned 32-bit values: one value for > seconds since midnight GMT Jan

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 10:12:37 H. Peter Anvin wrote: > On 06/02/2014 08:31 AM, Theodore Ts'o wrote: > > > > I wonder if it would make sense to try to promulgate via the Austin > > group, and possibly the C standards committee the concept of a bit > > pattern (that might commonly be INT_MAX or UIN

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread H. Peter Anvin
On 06/02/2014 08:31 AM, Theodore Ts'o wrote: > > I wonder if it would make sense to try to promulgate via the Austin > group, and possibly the C standards committee the concept of a bit > pattern (that might commonly be INT_MAX or UINT_MAX) that means "time > unknown", or "time indefinite" or "we

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Theodore Ts'o
On Mon, Jun 02, 2014 at 11:04:23AM -0400, Chuck Lever wrote: > I’m wondering what should be done about NFS. A solution for NFS should > match any scheme that is considered for local file systems, IMO. > > An alternative would be to “cap” the timestamps transmitted via NFSv3 by > Linux, so that a p

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Chuck Lever
On Jun 2, 2014, at 6:56 AM, Arnd Bergmann wrote: > On Sunday 01 June 2014 21:36:26 Nicolas Pitre wrote: >> >>> For actually running kernels beyond 2038, the best idea I've seen so >>> far is to disallow all broken code at compile time. I don't see >>> a choice but to audit the entire kernel for

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 09:07:00 Theodore Ts'o wrote: > Yes, there are some ongoing dicussions about changing the post-2038 > encoding of the timestamp in ext4, which is why this hasn't been fixed > yet. The main thing that's been missing is time for me to review the > patches, and a good way of wr

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread H. Peter Anvin
> On Jun 2, 2014, at 4:57, "Theodore Ts'o" wrote: > >> On Mon, Jun 02, 2014 at 12:56:42PM +0200, Arnd Bergmann wrote: >> >> I think you misunderstood what I suggested: the intent is to avoid >> seeing things break in 2038 by making them break much earlier. We have >> a solution for ext2 file sy

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Joseph S. Myers
On Sat, 31 May 2014, Dave Chinner wrote: > If we are changing the in-kernel timestamp to have a greater dynamic > range that anything we current support on disk, then we need support > for all filesystems for similar translation and constraint. The > filesystems need to be able to tell the kernel

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Theodore Ts'o
On Mon, Jun 02, 2014 at 02:38:09PM +0200, Arnd Bergmann wrote: > > "For new inodes we always reserve enough space for the kernel's known > extended fields, but for inodes created with an old kernel this might > not have been the case. None of the extended inode fields is critical > for correct fil

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Theodore Ts'o
Yes, there are some ongoing dicussions about changing the post-2038 encoding of the timestamp in ext4, which is why this hasn't been fixed yet. The main thing that's been missing is time for me to review the patches, and a good way of writing regression tests that will work (or at least not fail)

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 07:57:37 Theodore Ts'o wrote: > On Mon, Jun 02, 2014 at 12:56:42PM +0200, Arnd Bergmann wrote: > > > > I think you misunderstood what I suggested: the intent is to avoid > > seeing things break in 2038 by making them break much earlier. We have > > a solution for ext2 file s

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 07:57:37 Theodore Ts'o wrote: > On Mon, Jun 02, 2014 at 12:56:42PM +0200, Arnd Bergmann wrote: > > > > I think you misunderstood what I suggested: the intent is to avoid > > seeing things break in 2038 by making them break much earlier. We have > > a solution for ext2 file s

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Theodore Ts'o
On Mon, Jun 02, 2014 at 12:56:42PM +0200, Arnd Bergmann wrote: > > I think you misunderstood what I suggested: the intent is to avoid > seeing things break in 2038 by making them break much earlier. We have > a solution for ext2 file systems, it's called ext4, and we just need > to ensure that eve

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Monday 02 June 2014 10:28:22 Dave Chinner wrote: > On Sun, Jun 01, 2014 at 10:24:37AM +1000, Dave Chinner wrote: > > On Sat, May 31, 2014 at 05:37:52PM +0200, Arnd Bergmann wrote: > > > In my list at http://kernelnewbies.org/y2038, I found that almost > > > all file systems at least times until

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Roger Willcocks
On Mon, 2014-06-02 at 10:28 +1000, Dave Chinner wrote: > > The 32 bit second counters in timestamps are too small to represent > time beyond the unix epoch (jan 2038) correctly. Extend the on-disk > format for a timestamp to include an 8-bit epoch counter so that we > can extend time for up to 2

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Sunday 01 June 2014 13:26:03 H. Peter Anvin wrote: > Perhaps we should make this a kernel command line option instead, with the > settings: error out on outside the standard window, or a date indicating the > earliest date that should be recognized and do windowing (0 for no windowing, > 1970 fo

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Arnd Bergmann
On Sunday 01 June 2014 21:36:26 Nicolas Pitre wrote: > > > For actually running kernels beyond 2038, the best idea I've seen so > > far is to disallow all broken code at compile time. I don't see > > a choice but to audit the entire kernel for invalid uses on both > > 32 and 64 bit in the next few

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-02 Thread Geert Uytterhoeven
On Mon, Jun 2, 2014 at 4:22 AM, Dave Chinner wrote: > Filesystems place all sorts of userspace visible limits on storage - > ever tried to create a file >16TB on ext4? The on-disk format > doesn't support it, so it returns an out of range error (E2BIG, I > think) if you try. XFS, OTOH, handles thi

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-01 Thread Dave Chinner
On Sun, Jun 01, 2014 at 09:36:26PM -0400, Nicolas Pitre wrote: > On Sun, 1 Jun 2014, Arnd Bergmann wrote: > > On Saturday 31 May 2014 11:46:16 Nicolas Pitre wrote: > > For actually running kernels beyond 2038, the best idea I've seen so > > far is to disallow all broken code at compile time. I don'

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-01 Thread Nicolas Pitre
On Sun, 1 Jun 2014, Arnd Bergmann wrote: > On Saturday 31 May 2014 11:46:16 Nicolas Pitre wrote: > > > readonly if not in reality than in practice. > > > > For those (legacy) filesystems with a signed 32-bit timestamps, any > > attempt to create a timestamp past Jan 19 03:14:06 2038 UTC should b

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-01 Thread Dave Chinner
On Sun, Jun 01, 2014 at 10:24:37AM +1000, Dave Chinner wrote: > On Sat, May 31, 2014 at 05:37:52PM +0200, Arnd Bergmann wrote: > > In my list at http://kernelnewbies.org/y2038, I found that almost > > all file systems at least times until 2106, because they treat > > the on-disk value as unsigned o

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-01 Thread H. Peter Anvin
Perhaps we should make this a kernel command line option instead, with the settings: error out on outside the standard window, or a date indicating the earliest date that should be recognized and do windowing (0 for no windowing, 1970 for retconning the Unix epoch as unsigned...) But again, the

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-06-01 Thread Arnd Bergmann
On Saturday 31 May 2014 11:46:16 Nicolas Pitre wrote: > > readonly if not in reality than in practice. > > For those (legacy) filesystems with a signed 32-bit timestamps, any > attempt to create a timestamp past Jan 19 03:14:06 2038 UTC should be > (silently) clamped to 0x7fff and that value

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-31 Thread Dave Chinner
On Sat, May 31, 2014 at 01:41:56AM -0700, H. Peter Anvin wrote: > On 05/30/2014 10:54 PM, Dave Chinner wrote: > > > > If we are changing the in-kernel timestamp to have a greater dynamic > > range that anything we current support on disk, then we need support > > for all filesystems for similar tr

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-31 Thread Dave Chinner
On Sat, May 31, 2014 at 05:37:52PM +0200, Arnd Bergmann wrote: > On Saturday 31 May 2014 11:14:50 Dave Chinner wrote: > > On Fri, May 30, 2014 at 05:41:14PM -0700, H. Peter Anvin wrote: > > > On 05/30/2014 05:37 PM, Dave Chinner wrote: > > > > > > > > IOWs, the filesystem has to be able to reject

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-31 Thread Nicolas Pitre
On Sat, 31 May 2014, H. Peter Anvin wrote: > On 05/30/2014 10:54 PM, Dave Chinner wrote: > > > > If we are changing the in-kernel timestamp to have a greater dynamic > > range that anything we current support on disk, then we need support > > for all filesystems for similar translation and constr

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-31 Thread Arnd Bergmann
On Saturday 31 May 2014 11:14:50 Dave Chinner wrote: > On Fri, May 30, 2014 at 05:41:14PM -0700, H. Peter Anvin wrote: > > On 05/30/2014 05:37 PM, Dave Chinner wrote: > > > > > > IOWs, the filesystem has to be able to reject any attempt to set a > > > timestamp that is can't represent on disk othe

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-31 Thread H. Peter Anvin
On 05/30/2014 10:54 PM, Dave Chinner wrote: > > If we are changing the in-kernel timestamp to have a greater dynamic > range that anything we current support on disk, then we need support > for all filesystems for similar translation and constraint. The > filesystems need to be able to tell the ke

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-30 Thread Dave Chinner
[ Please don't top post. ] On Fri, May 30, 2014 at 06:22:55PM -0700, H. Peter Anvin wrote: > On May 30, 2014 6:14:50 PM PDT, Dave Chinner wrote: > >On Fri, May 30, 2014 at 05:41:14PM -0700, H. Peter Anvin wrote: > >> On 05/30/2014 05:37 PM, Dave Chinner wrote: > >> > > >> > IOWs, the filesystem

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-30 Thread H. Peter Anvin
No, not a strawman. Replace with Jan 26, 2038 and you have the same situation. On May 30, 2014 6:14:50 PM PDT, Dave Chinner wrote: >On Fri, May 30, 2014 at 05:41:14PM -0700, H. Peter Anvin wrote: >> On 05/30/2014 05:37 PM, Dave Chinner wrote: >> > >> > IOWs, the filesystem has to be able to rej

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-30 Thread Dave Chinner
On Fri, May 30, 2014 at 05:41:14PM -0700, H. Peter Anvin wrote: > On 05/30/2014 05:37 PM, Dave Chinner wrote: > > > > IOWs, the filesystem has to be able to reject any attempt to set a > > timestamp that is can't represent on disk otherwise Bad Stuff will > > happen, > > Actually it is questionab

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-30 Thread H. Peter Anvin
On 05/30/2014 05:37 PM, Dave Chinner wrote: > > IOWs, the filesystem has to be able to reject any attempt to set a > timestamp that is can't represent on disk otherwise Bad Stuff will > happen, Actually it is questionable if it is worse to reject a timestamp or just let it wrap. Rejecting a vali

Re: [RFC 11/32] xfs: convert to struct inode_time

2014-05-30 Thread Dave Chinner
On Fri, May 30, 2014 at 10:01:35PM +0200, Arnd Bergmann wrote: > xfs uses unsigned 32-bit seconds for inode timestamps, which will work > for the next 92 years, but the VFS uses struct timespec for timestamps, > which is only good until 2038 on 32-bit CPUs. > > This gets us one small step closer t

[RFC 11/32] xfs: convert to struct inode_time

2014-05-30 Thread Arnd Bergmann
xfs uses unsigned 32-bit seconds for inode timestamps, which will work for the next 92 years, but the VFS uses struct timespec for timestamps, which is only good until 2038 on 32-bit CPUs. This gets us one small step closer to lifting the VFS limit by using struct inode_time in XFS. Signed-off-by