summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-06-28 16:30:22 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2018-06-29 07:38:03 +1000
commit13a705286df9b9a5460933803bd42b4124246e5e (patch)
tree8c2e0eb7a6fcebc3b0f5a41b31144ba783dfb160
parent29737be7dc08ec4277cb8b587fd70103201658fe (diff)
downloadlinux-13a705286df9b9a5460933803bd42b4124246e5e.tar.gz
linux-13a705286df9b9a5460933803bd42b4124246e5e.tar.xz
nilfs2: use 64-bit superblock timstamps
The mount time field in the superblock uses a 64-bit timestamp, but calling get_seconds() may truncate the current time to 32 bits. This changes it to ktime_get_real_seconds() to avoid the potential overflow. Link: http://lkml.kernel.org/r/20180620075041.4154396-1-arnd@arndb.de Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: David Howells <dhowells@redhat.com> Cc: Jeff Layton <jlayton@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--fs/nilfs2/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 6ffeca84d7c3..1b9067cf4511 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -834,7 +834,7 @@ static int nilfs_setup_super(struct super_block *sb, int is_mount)
sbp[0]->s_max_mnt_count = cpu_to_le16(NILFS_DFL_MAX_MNT_COUNT);
sbp[0]->s_mnt_count = cpu_to_le16(mnt_count + 1);
- sbp[0]->s_mtime = cpu_to_le64(get_seconds());
+ sbp[0]->s_mtime = cpu_to_le64(ktime_get_real_seconds());
skip_mount_setup:
sbp[0]->s_state =