Re: [Y2038] [RFC 0/6] vfs: Add timestamp range check support

2016-11-02 Thread Darrick J. Wong
On Thu, Nov 03, 2016 at 09:48:27AM +1100, Dave Chinner wrote: > On Wed, Nov 02, 2016 at 08:04:50AM -0700, Deepa Dinamani wrote: > > The series is aimed at adding timestamp checking and policy > > related to it to vfs. > > > > The series was developed with discussions and guidance from > > Arnd Ber

Re: [Y2038] [RFC 0/6] vfs: Add timestamp range check support

2016-11-02 Thread Dave Chinner
On Wed, Nov 02, 2016 at 08:04:50AM -0700, Deepa Dinamani wrote: > The series is aimed at adding timestamp checking and policy > related to it to vfs. > > The series was developed with discussions and guidance from > Arnd Bergmann. > > The original idea for the series was the discussion: > https:/

[Y2038] [RFC 2/6] vfs: Add checks for filesystem timestamp limits

2016-11-02 Thread Deepa Dinamani
Allow read only mounts for filesystems that do not have maximum timestamps beyond the y2038 expiry timestamp. Also, allow a sysctl override to all such filesystems to be mounted with write permissions. Alternatively, a mount option can be created to allow or disallow range check based clamps and

[Y2038] [RFC 6/6] utimes: Clamp the timestamps before update

2016-11-02 Thread Deepa Dinamani
POSIX.1 section for futimens, utimensat and utimes says: The file's relevant timestamp shall be set to the greatest value supported by the file system that is not greater than the specified time. Clamp the timestamps accordingly before assignment. Note that clamp_t macro is used for clamping here

[Y2038] [RFC 5/6] vfs: Add timestamp_truncate() api

2016-11-02 Thread Deepa Dinamani
timespec_trunc() function is used to truncate a filesystem timestamp to the right granularity. But, the function does not clamp tv_sec part of the timestamps according to the filesystem timestamp limits. Also, timespec_trunc() is exclusively used for filesystem timestamps. Move the api to be part

[Y2038] [RFC 4/6] ext4: Initialize timestamps limits

2016-11-02 Thread Deepa Dinamani
ext4 has different overflow limits for max filesystem timestamps based on the extra bytes available. Signed-off-by: Deepa Dinamani Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: linux-e...@vger.kernel.org --- fs/ext4/ext4.h | 4 fs/ext4/super.c | 7 ++- 2 files changed, 10 insertions(+),

[Y2038] [RFC 1/6] vfs: Add file timestamp range support

2016-11-02 Thread Deepa Dinamani
Add fields to the superblock to track the min and max timestamps supported by filesystems. Initially, when a superblock is allocated, initialize it to the max and min values the fields can hold. Individual filesystems override these to match their actual limits. Pseudo filesystems are assumed to

[Y2038] [RFC 3/6] afs: Add time limits in the super block

2016-11-02 Thread Deepa Dinamani
Note that all the filesystems that have such simple limits will be initialized in the same patch. Signed-off-by: Deepa Dinamani Cc: linux-...@lists.infradead.org --- fs/afs/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/afs/super.c b/fs/afs/super.c index fbdb022..ab00434 100644

[Y2038] [RFC 0/6] vfs: Add timestamp range check support

2016-11-02 Thread Deepa Dinamani
The series is aimed at adding timestamp checking and policy related to it to vfs. The series was developed with discussions and guidance from Arnd Bergmann. The original idea for the series was the discussion: https://lkml.org/lkml/2014/5/30/551 Patches 5 and 6 can be merged only after vfs is tr