History

Merge tag 'y2038-vfs' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground

Pull y2038 vfs updates from Arnd Bergmann: "Add inode timestamp clamping. This series from Deepa Dinamani adds a per-superblock minimum/maximum timestamp limit for a file system, and clamps timestamps as they are written, to avoid random behavior from integer overflow as well as having different time stamps on disk vs in memory. At mount time, a warning is now printed for any file system that can represent current timestamps but not future timestamps more than 30 years into the future, similar to the arbitrary 30 year limit that was added to settimeofday(). This was picked as a compromise to warn users to migrate to other file systems (e.g. ext4 instead of ext3) when they need the file system to survive beyond 2038 (or similar limits in other file systems), but not get in the way of normal usage" * tag 'y2038-vfs' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground: ext4: Reduce ext4 timestamp warnings isofs: Initialize filesystem timestamp ranges pstore: fs superblock limits fs: omfs: Initialize filesystem timestamp ranges fs: hpfs: Initialize filesystem timestamp ranges fs: ceph: Initialize filesystem timestamp ranges fs: sysv: Initialize filesystem timestamp ranges fs: affs: Initialize filesystem timestamp ranges fs: fat: Initialize filesystem timestamp ranges fs: cifs: Initialize filesystem timestamp ranges fs: nfs: Initialize filesystem timestamp ranges ext4: Initialize timestamps limits 9p: Fill min and max timestamps in sb fs: Fill in max and min timestamps in superblock utimes: Clamp the timestamps before update mount: Add mount warning for impending timestamp expiry timestamp_truncate: Replace users of timespec64_trunc vfs: Add timestamp_truncate() api vfs: Add file timestamp range support

Linus Torvalds committed 7 years ago

Commit cfb82e12 parents b41dae0 cba465b47 files · +294 −72Browse files

Showing the changes to include/linux (2 of 47 files). Show all

Unified · Split

2 files
  1. include/linux/fs.h +5 −0
  2. include/linux/time64.h +2 −0
include/linux/fs.h+5−0
@@ -732,6 +732,8 @@ struct inode { · 731 unmodified lines
732 void *i_private; /* fs or device private pointer */732 void *i_private; /* fs or device private pointer */
733} __randomize_layout;733} __randomize_layout;
734 734
735struct timespec64 timestamp_truncate(struct timespec64 t, struct inode *inode);
736
735static inline unsigned int i_blocksize(const struct inode *node)737static inline unsigned int i_blocksize(const struct inode *node)
736{738{
737 return (1 << node->i_blkbits);739 return (1 << node->i_blkbits);
@@ -1458,6 +1460,9 @@ struct super_block { · 720 unmodified lines
1458 1460
1459 /* Granularity of c/m/atime in ns (cannot be worse than a second) */1461 /* Granularity of c/m/atime in ns (cannot be worse than a second) */
1460 u32 s_time_gran;1462 u32 s_time_gran;
1463 /* Time limits for c/m/atime in seconds */
1464 time64_t s_time_min;
1465 time64_t s_time_max;
1461#ifdef CONFIG_FSNOTIFY1466#ifdef CONFIG_FSNOTIFY
1462 __u32 s_fsnotify_mask;1467 __u32 s_fsnotify_mask;
1463 struct fsnotify_mark_connector __rcu *s_fsnotify_marks;1468 struct fsnotify_mark_connector __rcu *s_fsnotify_marks;
include/linux/time64.h+2−0
@@ -30,6 +30,8 @@ struct itimerspec64 { · 29 unmodified lines
30 30
31/* Located here for timespec[64]_valid_strict */31/* Located here for timespec[64]_valid_strict */
32#define TIME64_MAX ((s64)~((u64)1 << 63))32#define TIME64_MAX ((s64)~((u64)1 << 63))
33#define TIME64_MIN (-TIME64_MAX - 1)
34
33#define KTIME_MAX ((s64)~((u64)1 << 63))35#define KTIME_MAX ((s64)~((u64)1 << 63))
34#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)36#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
35 37

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t