Skip to content

Commit 21a1a52

Browse files
arndbtorvalds
authored andcommitted
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: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cbf6898 commit 21a1a52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nilfs2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int nilfs_setup_super(struct super_block *sb, int is_mount)
834834
sbp[0]->s_max_mnt_count = cpu_to_le16(NILFS_DFL_MAX_MNT_COUNT);
835835

836836
sbp[0]->s_mnt_count = cpu_to_le16(mnt_count + 1);
837-
sbp[0]->s_mtime = cpu_to_le64(get_seconds());
837+
sbp[0]->s_mtime = cpu_to_le64(ktime_get_real_seconds());
838838

839839
skip_mount_setup:
840840
sbp[0]->s_state =

0 commit comments

Comments
 (0)