add patch migrate-into-vfs-crypto-engine
[ext4-patch-queue.git] / make-journal-y2038-safe
blob9f322cc6c4b2e74fe2472140585a1c98e6e66e74
1 jbd2: make journal y2038 safe
3 From: Arnd Bergmann <arnd@arndb.de>
5 The jbd2 journal stores the commit time in 64-bit seconds and 32-bit
6 nanoseconds, which avoids an overflow in 2038, but it gets the numbers
7 from current_kernel_time(), which uses 'long' seconds on 32-bit
8 architectures.
10 This simply changes the code to call current_kernel_time64() so
11 we use 64-bit seconds consistently.
13 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
14 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 Reviewed-by: Jan Kara <jack@suse.cz>
16 Cc: stable@vger.kernel.org
17 ---
18  fs/jbd2/commit.c | 2 +-
19  1 file changed, 1 insertion(+), 1 deletion(-)
21 diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
22 index 8f7d1339c973..5bb565f9989c 100644
23 --- a/fs/jbd2/commit.c
24 +++ b/fs/jbd2/commit.c
25 @@ -124,7 +124,7 @@ static int journal_submit_commit_record(journal_t *journal,
26         struct commit_header *tmp;
27         struct buffer_head *bh;
28         int ret;
29 -       struct timespec now = current_kernel_time();
30 +       struct timespec64 now = current_kernel_time64();
32         *cbh = NULL;
34 -- 
35 2.9.0