add patch improve-code-readability-in-ext4_iget
[ext4-patch-queue.git] / use-64bit-timestamps-for-mmp_time
blob49930ddb50a1b183b2bcd186c2eeacbbcc67226e
1 ext4: use 64-bit timestamps for mmp_time
3 From: Arnd Bergmann <arnd@arndb.de>
5 The mmp_time field is 64 bits wide, which is good, but calling
6 get_seconds() results in a 32-bit value on 32-bit architectures. Using
7 ktime_get_real_seconds() instead returns 64 bits everywhere.
9 Reviewed-by: Andreas Dilger <adilger@dilger.ca>
10 Reviewed-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 ---
14  fs/ext4/mmp.c | 6 +++---
15  1 file changed, 3 insertions(+), 3 deletions(-)
17 diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
18 index 27b9a76a0dfa..39da4eb48361 100644
19 --- a/fs/ext4/mmp.c
20 +++ b/fs/ext4/mmp.c
21 @@ -147,7 +147,7 @@ static int kmmpd(void *data)
23         mmp_block = le64_to_cpu(es->s_mmp_block);
24         mmp = (struct mmp_struct *)(bh->b_data);
25 -       mmp->mmp_time = cpu_to_le64(get_seconds());
26 +       mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds());
27         /*
28          * Start with the higher mmp_check_interval and reduce it if
29          * the MMP block is being updated on time.
30 @@ -165,7 +165,7 @@ static int kmmpd(void *data)
31                         seq = 1;
33                 mmp->mmp_seq = cpu_to_le32(seq);
34 -               mmp->mmp_time = cpu_to_le64(get_seconds());
35 +               mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds());
36                 last_update_time = jiffies;
38                 retval = write_mmp_block(sb, bh);
39 @@ -244,7 +244,7 @@ static int kmmpd(void *data)
40          * Unmount seems to be clean.
41          */
42         mmp->mmp_seq = cpu_to_le32(EXT4_MMP_SEQ_CLEAN);
43 -       mmp->mmp_time = cpu_to_le64(get_seconds());
44 +       mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds());
46         retval = write_mmp_block(sb, bh);
48 -- 
49 2.9.0