diff options
author | Theodore Ts'o <tytso@mit.edu> | 2019-08-12 13:44:49 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-08-12 13:44:49 -0400 |
commit | cd2d99229dc96219547e6349841e1aad851c6acc (patch) | |
tree | b6bf93e9c34772d32b2677e5a6267e328c82f8ff /fs/ext4/ext4.h | |
parent | bb5835edcdf8bf78bbe51cff13e332c439bc0567 (diff) |
ext4: drop legacy pre-1970 encoding workaround
Originally, support for expanded timestamps had a bug in that pre-1970
times were erroneously encoded as being in the the 24th century. This
was fixed in commit a4dad1ae24f8 ("ext4: Fix handling of extended
tv_sec") which landed in 4.4. Starting with 4.4, pre-1970 timestamps
were correctly encoded, but for backwards compatibility those
incorrectly encoded timestamps were mapped back to the pre-1970 dates.
Given that backwards compatibility workaround has been around for 4
years, and given that running e2fsck from e2fsprogs 1.43.2 and later
will offer to fix these timestamps (which has been released for 3
years), it's past time to drop the legacy workaround from the kernel.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index e2d8ad27f4d1..17cc2dc13174 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -828,21 +828,8 @@ static inline __le32 ext4_encode_extra_time(struct timespec64 *time) | |||
828 | static inline void ext4_decode_extra_time(struct timespec64 *time, | 828 | static inline void ext4_decode_extra_time(struct timespec64 *time, |
829 | __le32 extra) | 829 | __le32 extra) |
830 | { | 830 | { |
831 | if (unlikely(extra & cpu_to_le32(EXT4_EPOCH_MASK))) { | 831 | if (unlikely(extra & cpu_to_le32(EXT4_EPOCH_MASK))) |
832 | |||
833 | #if 1 | ||
834 | /* Handle legacy encoding of pre-1970 dates with epoch | ||
835 | * bits 1,1. (This backwards compatibility may be removed | ||
836 | * at the discretion of the ext4 developers.) | ||
837 | */ | ||
838 | u64 extra_bits = le32_to_cpu(extra) & EXT4_EPOCH_MASK; | ||
839 | if (extra_bits == 3 && ((time->tv_sec) & 0x80000000) != 0) | ||
840 | extra_bits = 0; | ||
841 | time->tv_sec += extra_bits << 32; | ||
842 | #else | ||
843 | time->tv_sec += (u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK) << 32; | 832 | time->tv_sec += (u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK) << 32; |
844 | #endif | ||
845 | } | ||
846 | time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; | 833 | time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; |
847 | } | 834 | } |
848 | 835 | ||