From 3e6fa39f7e79c36d70798f9d313b035b7ebdad8c Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 12 Aug 2019 14:29:57 -0400 Subject: [PATCH] add patch drop-legacy-pre-1970-encoding-workaround. --- drop-legacy-pre-1970-encoding-workaround | 46 ++++++++++++++++++++++++++++++++ series | 3 ++- timestamps | 21 ++++++++------- 3 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 drop-legacy-pre-1970-encoding-workaround diff --git a/drop-legacy-pre-1970-encoding-workaround b/drop-legacy-pre-1970-encoding-workaround new file mode 100644 index 00000000..1604a098 --- /dev/null +++ b/drop-legacy-pre-1970-encoding-workaround @@ -0,0 +1,46 @@ +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 +--- + fs/ext4/ext4.h | 15 +-------------- + 1 file changed, 1 insertion(+), 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) + static inline void ext4_decode_extra_time(struct timespec64 *time, + __le32 extra) + { +- if (unlikely(extra & cpu_to_le32(EXT4_EPOCH_MASK))) { +- +-#if 1 +- /* Handle legacy encoding of pre-1970 dates with epoch +- * bits 1,1. (This backwards compatibility may be removed +- * at the discretion of the ext4 developers.) +- */ +- u64 extra_bits = le32_to_cpu(extra) & EXT4_EPOCH_MASK; +- if (extra_bits == 3 && ((time->tv_sec) & 0x80000000) != 0) +- extra_bits = 0; +- time->tv_sec += extra_bits << 32; +-#else ++ if (unlikely(extra & cpu_to_le32(EXT4_EPOCH_MASK))) + time->tv_sec += (u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK) << 32; +-#endif +- } + time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; + } + diff --git a/series b/series index 92300fa4..169f4208 100644 --- a/series +++ b/series @@ -1,4 +1,4 @@ -# v5.3-rc3 +# v5.3-rc4 fix-warning-when-turn-on-dioread_nolock-and-inline_data remove-unnecessary-error-check @@ -6,6 +6,7 @@ do-not-descrease-bufferheads-refcount add-clear_es_cache-ioctl add-getstate-ioctl return-extent-cache-info-via-fiemap +drop-legacy-pre-1970-encoding-workaround #################################################### # unstable patches diff --git a/timestamps b/timestamps index 5925963a..f4f5b892 100755 --- a/timestamps +++ b/timestamps @@ -11,13 +11,14 @@ touch -d @1543184911 load-jmap-from-journal touch -d @1543184971 disable-writeback touch -d @1543185031 add-ext4-journal-lazy-mount-option touch -d @1558930766 save-patch -touch -d @1561168680 stable-boundary -touch -d @1565015214 fix-warning-when-turn-on-dioread_nolock-and-inline_data -touch -d @1565016977 remove-unnecessary-error-check -touch -d @1565279410 do-not-descrease-bufferheads-refcount -touch -d @1565538957 series -touch -d @1565539144 add-clear_es_cache-ioctl -touch -d @1565539237 add-getstate-ioctl -touch -d @1565546306 return-extent-cache-info-via-fiemap -touch -d @1565553008 status -touch -d @1565559606 timestamps +touch -d @1565555261 fix-warning-when-turn-on-dioread_nolock-and-inline_data +touch -d @1565555321 remove-unnecessary-error-check +touch -d @1565555381 do-not-descrease-bufferheads-refcount +touch -d @1565555441 add-clear_es_cache-ioctl +touch -d @1565555501 add-getstate-ioctl +touch -d @1565555561 return-extent-cache-info-via-fiemap +touch -d @1565555621 stable-boundary +touch -d @1565630642 series +touch -d @1565631889 drop-legacy-pre-1970-encoding-workaround +touch -d @1565631890 status +touch -d @1565634586 timestamps -- 2.11.4.GIT