[Y2038] [RFC 2/5] xfs: [variant B] add time64 version of xfs_bstat

2019-11-12 Thread Arnd Bergmann
The ioctl definitions for XFS_IOC_SWAPEXT, XFS_IOC_FSBULKSTAT and XFS_IOC_FSBULKSTAT_SINGLE are part of libxfs and based on time_t. The definition for time_t differs between current kernels and coming 32-bit libc variants that define it as 64-bit. For most ioctls, that means the kernel has to be

[Y2038] [RFC 1/5] xfs: [variant A] avoid time_t in user api

2019-11-12 Thread Arnd Bergmann
The ioctl definitions for XFS_IOC_SWAPEXT, XFS_IOC_FSBULKSTAT and XFS_IOC_FSBULKSTAT_SINGLE are part of libxfs and based on time_t. The definition for time_t differs between current kernels and coming 32-bit libc variants that define it as 64-bit. For most ioctls, that means the kernel has to be

[Y2038] [RFC 0/5] xfs: y2038 conversion

2019-11-12 Thread Arnd Bergmann
This is part of a longer set of changes to clean up the last remaining bits for the y2038 conversion. In XFS, three distinct problems need to be addressed: 1. The use of time_t in kernel sources -- I'm in the process of removing all of them so we can remove the definition itself, making it

[Y2038] [RFC 5/5] xfs: use 40-bit quota time limits

2019-11-12 Thread Arnd Bergmann
The quota handling in xfs is based around an in-memory representation of time_t, which overflows in year 2038 on 32-bit architectures, and an on-disk representation of __be32, which overflows in year 2106 based on interpreting the values as unsigned. Extend both to allow for much longer times:

[Y2038] [RFC 4/5] xfs: extend inode format for 40-bit timestamps

2019-11-12 Thread Arnd Bergmann
XFS is the only major file system that lacks timestamps beyond year 2038, and is already being deployed in systems that may have to be supported beyond that time. Fortunately, the inode format still has a few reserved bits that can be used to extend the current format. There are two bits in the

Re: [Y2038] [alsa-devel] [PATCH v6 5/8] ALSA: Avoid using timespec for struct snd_rawmidi_status

2019-11-12 Thread Takashi Iwai
On Tue, 12 Nov 2019 21:04:10 +0100, Arnd Bergmann wrote: > > On Tue, Nov 12, 2019 at 5:38 PM Takashi Iwai wrote: > > On Tue, 12 Nov 2019 16:16:39 +0100, Arnd Bergmann wrote: > > > +#ifndef __KERNEL__ > > > struct snd_rawmidi_status { > > > int stream; > > > + unsigned char

Re: [Y2038] [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status

2019-11-12 Thread Arnd Bergmann
On Tue, Nov 12, 2019 at 4:42 PM Takashi Iwai wrote: > > @@ -761,6 +761,7 @@ struct snd_timer_params { > > unsigned char reserved[60]; /* reserved */ > > }; > > > > +#ifndef __KERNEL__ > > struct snd_timer_status { > > struct timespec tstamp; /* Timestamp - last update

Re: [Y2038] [alsa-devel] [PATCH v6 5/8] ALSA: Avoid using timespec for struct snd_rawmidi_status

2019-11-12 Thread Arnd Bergmann
On Tue, Nov 12, 2019 at 5:38 PM Takashi Iwai wrote: > On Tue, 12 Nov 2019 16:16:39 +0100, Arnd Bergmann wrote: > > +#ifndef __KERNEL__ > > struct snd_rawmidi_status { > > int stream; > > + unsigned char pad1[sizeof(time_t) - sizeof(int)]; > > struct timespec tstamp; /*

Re: [Y2038] [PATCH v6 0/8] Fix year 2038 issue for sound subsystem

2019-11-12 Thread Takashi Iwai
On Tue, 12 Nov 2019 16:16:34 +0100, Arnd Bergmann wrote: > > This is a series I worked on with Baolin in 2017 and 2018, but we > never quite managed to finish up the last pieces. During the > ALSA developer meetup at ELC-E 2018 in Edinburgh, a decision was > made to go with this approach for

Re: [Y2038] [RFC 4/5] xfs: extend inode format for 40-bit timestamps

2019-11-12 Thread Dave Chinner
On Tue, Nov 12, 2019 at 01:09:09PM +0100, Arnd Bergmann wrote: > XFS is the only major file system that lacks timestamps beyond year 2038, > and is already being deployed in systems that may have to be supported > beyond that time. > > Fortunately, the inode format still has a few reserved bits

Re: [Y2038] [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status

2019-11-12 Thread Takashi Iwai
On Tue, 12 Nov 2019 21:08:17 +0100, Arnd Bergmann wrote: > > On Tue, Nov 12, 2019 at 4:42 PM Takashi Iwai wrote: > > > > @@ -761,6 +761,7 @@ struct snd_timer_params { > > > unsigned char reserved[60]; /* reserved */ > > > }; > > > > > > +#ifndef __KERNEL__ > > > struct

Re: [Y2038] [PATCH 11/23] y2038: rusage: use __kernel_old_timeval

2019-11-12 Thread Cyrill Gorcunov
On Fri, Nov 08, 2019 at 10:12:10PM +0100, Arnd Bergmann wrote: > There are two 'struct timeval' fields in 'struct rusage'. > > Unfortunately the definition of timeval is now ambiguous when used in > user space with a libc that has a 64-bit time_t, and this also changes > the 'rusage' definition

Re: [Y2038] [PATCH 14/16] drm/msm: avoid using 'timespec'

2019-11-12 Thread Jordan Crouse
On Fri, Nov 08, 2019 at 10:32:52PM +0100, Arnd Bergmann wrote: > The timespec structure and associated interfaces are deprecated and will > be removed in the future because of the y2038 overflow. > > The use of ktime_to_timespec() in timeout_to_jiffies() does not > suffer from that overflow, but

Re: [Y2038] [RFC 4/5] xfs: extend inode format for 40-bit timestamps

2019-11-12 Thread Amir Goldstein
On Tue, Nov 12, 2019 at 4:16 PM Christoph Hellwig wrote: > > Amir just send another patch dealing with the time stamps. I'd suggest > you chime into the discussion in that thread. That's right I just posted the ext4 style extend to 34bits yesterday [1], but I like your version so much better,

[Y2038] [PATCH v6 1/8] ALSA: Replace timespec with timespec64

2019-11-12 Thread Arnd Bergmann
From: Baolin Wang Since timespec is not year 2038 safe on 32bit system, and we need to convert all timespec variables to timespec64 type for sound subsystem. This patch is used to do preparation for following patches, that will convert all structures defined in uapi/sound/asound.h to use 64-bit

[Y2038] [PATCH v6 8/8] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control

2019-11-12 Thread Arnd Bergmann
The snd_pcm_mmap_status and snd_pcm_mmap_control interfaces are one of the trickiest areas to get right when moving to 64-bit time_t in user space. The snd_pcm_mmap_status structure layout is incompatible with user space that uses a 64-bit time_t, so we need a new layout for it. Since the

[Y2038] [PATCH v6 4/8] ALSA: Avoid using timespec for struct snd_pcm_status

2019-11-12 Thread Arnd Bergmann
From: Baolin Wang The struct snd_pcm_status will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Userspace will use SNDRV_PCM_IOCTL_STATUS and SNDRV_PCM_IOCTL_STATUS_EXT as commands to issue ioctl() to fill the 'snd_pcm_status' structure in

[Y2038] [PATCH v6 5/8] ALSA: Avoid using timespec for struct snd_rawmidi_status

2019-11-12 Thread Arnd Bergmann
From: Baolin Wang The struct snd_rawmidi_status will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Thus we introduced 'struct snd_rawmidi_status32' and 'struct snd_rawmidi_status64' to handle 32bit time_t and 64bit time_t in native mode, which

[Y2038] [PATCH v6 6/8] ALSA: Avoid using timespec for struct snd_timer_tread

2019-11-12 Thread Arnd Bergmann
From: Baolin Wang The struct snd_timer_tread will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Since the struct snd_timer_tread is passed through read() rather than ioctl(), and the read syscall has no command number that lets us pick between

Re: [Y2038] [RFC 4/5] xfs: extend inode format for 40-bit timestamps

2019-11-12 Thread Arnd Bergmann
On Tue, Nov 12, 2019 at 4:02 PM Amir Goldstein wrote: > > On Tue, Nov 12, 2019 at 4:16 PM Christoph Hellwig wrote: > > > > Amir just send another patch dealing with the time stamps. I'd suggest > > you chime into the discussion in that thread. > > That's right I just posted the ext4 style

Re: [Y2038] [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status

2019-11-12 Thread Takashi Iwai
On Tue, 12 Nov 2019 16:16:36 +0100, Arnd Bergmann wrote: > > From: Baolin Wang > > struct snd_timer_status uses 'timespec' type variables to record > timestamp, which will be changed to an incompatible layout with > updated user space using 64-bit time_t. > > To handle both the old and the new

Re: [Y2038] [RFC 1/5] xfs: [variant A] avoid time_t in user api

2019-11-12 Thread Christoph Hellwig
On Tue, Nov 12, 2019 at 01:09:06PM +0100, Arnd Bergmann wrote: > However, as long as two observations are true, a much simpler solution > can be used: > > 1. xfsprogs is the only user space project that has a copy of this header We can't guarantee that. > 2. xfsprogs already has a replacement

Re: [Y2038] [RFC 4/5] xfs: extend inode format for 40-bit timestamps

2019-11-12 Thread Christoph Hellwig
Amir just send another patch dealing with the time stamps. I'd suggest you chime into the discussion in that thread. ___ Y2038 mailing list Y2038@lists.linaro.org https://lists.linaro.org/mailman/listinfo/y2038

[Y2038] [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status

2019-11-12 Thread Arnd Bergmann
From: Baolin Wang struct snd_timer_status uses 'timespec' type variables to record timestamp, which will be changed to an incompatible layout with updated user space using 64-bit time_t. To handle both the old and the new layout on 32-bit architectures, this patch introduces 'struct

[Y2038] [PATCH v6 7/8] ALSA: move snd_pcm_ioctl_sync_ptr_compat into pcm_native.c

2019-11-12 Thread Arnd Bergmann
This is a preparation patch, moving the compat handler for snd_pcm_ioctl_sync_ptr_compat from pcm_compat.c to pcm_native.c. No other changes are indented. Signed-off-by: Baolin Wang Signed-off-by: Arnd Bergmann --- sound/core/pcm_compat.c | 98 --

[Y2038] [PATCH v6 3/8] ALSA: Avoid using timespec for struct snd_ctl_elem_value

2019-11-12 Thread Arnd Bergmann
From: Baolin Wang The struct snd_ctl_elem_value will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Since there are no drivers will implemented the tstamp member of the struct snd_ctl_elem_value, and also the stucture size will not be changed if

[Y2038] [PATCH v6 0/8] Fix year 2038 issue for sound subsystem

2019-11-12 Thread Arnd Bergmann
This is a series I worked on with Baolin in 2017 and 2018, but we never quite managed to finish up the last pieces. During the ALSA developer meetup at ELC-E 2018 in Edinburgh, a decision was made to go with this approach for keeping best compatibility with existing source code, and then I failed

Re: [Y2038] [PATCH 13/16] hfs/hfsplus: use 64-bit inode timestamps

2019-11-12 Thread Ernesto A . Fernández
On Fri, Nov 08, 2019 at 10:32:51PM +0100, Arnd Bergmann wrote: > The interpretation of on-disk timestamps in HFS and HFS+ differs > between 32-bit and 64-bit kernels at the moment. Use 64-bit timestamps > consistently so apply the current 64-bit behavior everyhere. > > According to the official

Re: [Y2038] [RFC 1/5] xfs: [variant A] avoid time_t in user api

2019-11-12 Thread Darrick J. Wong
On Tue, Nov 12, 2019 at 03:16:00PM +0100, Christoph Hellwig wrote: > On Tue, Nov 12, 2019 at 01:09:06PM +0100, Arnd Bergmann wrote: > > However, as long as two observations are true, a much simpler solution > > can be used: > > > > 1. xfsprogs is the only user space project that has a copy of

Re: [Y2038] [PATCH 13/16] hfs/hfsplus: use 64-bit inode timestamps

2019-11-12 Thread Viacheslav Dubeyko
> On Nov 9, 2019, at 12:32 AM, Arnd Bergmann wrote: > > The interpretation of on-disk timestamps in HFS and HFS+ differs > between 32-bit and 64-bit kernels at the moment. Use 64-bit timestamps > consistently so apply the current 64-bit behavior everyhere. > > According to the official