+ hfs-hfsplus-stop-using-timespec-based-interfaces.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: hfs/hfsplus: stop using timespec based interfaces
has been added to the -mm tree.  Its filename is
     hfs-hfsplus-stop-using-timespec-based-interfaces.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/hfs-hfsplus-stop-using-timespec-based-interfaces.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/hfs-hfsplus-stop-using-timespec-based-interfaces.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Arnd Bergmann <arnd@xxxxxxxx>
Subject: hfs/hfsplus: stop using timespec based interfaces

The native HFS and HFS+ timestamps overflow in year 2040, two years after
the Unix y2038 overflow.  On 32-bit systems, we currently go through a
conversion that overflows in 2038, while the VFS code is now capable of
representing a 64-bit time range.

This removes the unnecessary conversion, using 64-bit timestamps
consistently

Link: http://lkml.kernel.org/r/20180710214131.4106527-2-arnd@xxxxxxxx
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Deepa Dinamani <deepa.kernel@xxxxxxxxx>
Cc: "Ernesto A. Fernandez" <ernesto.mnd.fernandez@xxxxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: Jeff Layton <jlayton@xxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Viacheslav Dubeyko <slava@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/hfs/hfs_fs.h         |    4 ++--
 fs/hfs/inode.c          |    4 ++--
 fs/hfsplus/hfsplus_fs.h |    4 ++--
 fs/hfsplus/inode.c      |   12 ++++++------
 4 files changed, 12 insertions(+), 12 deletions(-)

diff -puN fs/hfs/hfs_fs.h~hfs-hfsplus-stop-using-timespec-based-interfaces fs/hfs/hfs_fs.h
--- a/fs/hfs/hfs_fs.h~hfs-hfsplus-stop-using-timespec-based-interfaces
+++ a/fs/hfs/hfs_fs.h
@@ -273,9 +273,9 @@ static inline __be32 __hfs_u_to_mtime(ti
 #define HFS_I(inode)	(container_of(inode, struct hfs_inode_info, vfs_inode))
 #define HFS_SB(sb)	((struct hfs_sb_info *)(sb)->s_fs_info)
 
-#define hfs_m_to_utime(time)   (struct timespec){ .tv_sec = __hfs_m_to_utime(time) }
+#define hfs_m_to_utime(time)   (struct timespec64){ .tv_sec = __hfs_m_to_utime(time) }
 #define hfs_u_to_mtime(time)   __hfs_u_to_mtime((time).tv_sec)
-#define hfs_mtime()		__hfs_u_to_mtime(get_seconds())
+#define hfs_mtime()		__hfs_u_to_mtime(ktime_get_real_seconds())
 
 static inline const char *hfs_mdb_name(struct super_block *sb)
 {
diff -puN fs/hfs/inode.c~hfs-hfsplus-stop-using-timespec-based-interfaces fs/hfs/inode.c
--- a/fs/hfs/inode.c~hfs-hfsplus-stop-using-timespec-based-interfaces
+++ a/fs/hfs/inode.c
@@ -351,7 +351,7 @@ static int hfs_read_inode(struct inode *
 		inode->i_mode &= ~hsb->s_file_umask;
 		inode->i_mode |= S_IFREG;
 		inode->i_ctime = inode->i_atime = inode->i_mtime =
-				timespec_to_timespec64(hfs_m_to_utime(rec->file.MdDat));
+				hfs_m_to_utime(rec->file.MdDat);
 		inode->i_op = &hfs_file_inode_operations;
 		inode->i_fop = &hfs_file_operations;
 		inode->i_mapping->a_ops = &hfs_aops;
@@ -362,7 +362,7 @@ static int hfs_read_inode(struct inode *
 		HFS_I(inode)->fs_blocks = 0;
 		inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask);
 		inode->i_ctime = inode->i_atime = inode->i_mtime =
-				timespec_to_timespec64(hfs_m_to_utime(rec->dir.MdDat));
+				hfs_m_to_utime(rec->dir.MdDat);
 		inode->i_op = &hfs_dir_inode_operations;
 		inode->i_fop = &hfs_dir_operations;
 		break;
diff -puN fs/hfsplus/hfsplus_fs.h~hfs-hfsplus-stop-using-timespec-based-interfaces fs/hfsplus/hfsplus_fs.h
--- a/fs/hfsplus/hfsplus_fs.h~hfs-hfsplus-stop-using-timespec-based-interfaces
+++ a/fs/hfsplus/hfsplus_fs.h
@@ -555,8 +555,8 @@ static inline __be32 __hfsp_ut2mt(time64
 }
 
 /* compatibility */
-#define hfsp_mt2ut(t)		(struct timespec){ .tv_sec = __hfsp_mt2ut(t) }
+#define hfsp_mt2ut(t)		(struct timespec64){ .tv_sec = __hfsp_mt2ut(t) }
 #define hfsp_ut2mt(t)		__hfsp_ut2mt((t).tv_sec)
-#define hfsp_now2mt()		__hfsp_ut2mt(get_seconds())
+#define hfsp_now2mt()		__hfsp_ut2mt(ktime_get_real_seconds())
 
 #endif
diff -puN fs/hfsplus/inode.c~hfs-hfsplus-stop-using-timespec-based-interfaces fs/hfsplus/inode.c
--- a/fs/hfsplus/inode.c~hfs-hfsplus-stop-using-timespec-based-interfaces
+++ a/fs/hfsplus/inode.c
@@ -493,9 +493,9 @@ int hfsplus_cat_read_inode(struct inode
 		hfsplus_get_perms(inode, &folder->permissions, 1);
 		set_nlink(inode, 1);
 		inode->i_size = 2 + be32_to_cpu(folder->valence);
-		inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(folder->access_date));
-		inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(folder->content_mod_date));
-		inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(folder->attribute_mod_date));
+		inode->i_atime = hfsp_mt2ut(folder->access_date);
+		inode->i_mtime = hfsp_mt2ut(folder->content_mod_date);
+		inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date);
 		HFSPLUS_I(inode)->create_date = folder->create_date;
 		HFSPLUS_I(inode)->fs_blocks = 0;
 		if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) {
@@ -531,9 +531,9 @@ int hfsplus_cat_read_inode(struct inode
 			init_special_inode(inode, inode->i_mode,
 					   be32_to_cpu(file->permissions.dev));
 		}
-		inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(file->access_date));
-		inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(file->content_mod_date));
-		inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(file->attribute_mod_date));
+		inode->i_atime = hfsp_mt2ut(file->access_date);
+		inode->i_mtime = hfsp_mt2ut(file->content_mod_date);
+		inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date);
 		HFSPLUS_I(inode)->create_date = file->create_date;
 	} else {
 		pr_err("bad catalog entry used to create inode\n");
_

Patches currently in -mm which might be from arnd@xxxxxxxx are

kasan-only-select-slub_debug-with-sysfs=y.patch
firewire-use-64-bit-time_t-based-interfaces.patch
ocfs2-dlmglue-clean-up-timestamp-handling.patch
shmem-use-monotonic-time-for-i_generation.patch
mm-zsmalloc-make-several-functions-and-a-struct-static-fix.patch
procfs-uptime-use-ktime_get_boottime_ts64.patch
crash-print-timestamp-using-time64_t.patch
nilfs2-use-64-bit-superblock-timstamps.patch
hfs-hfsplus-follow-macos-time-behavior.patch
hfs-hfsplus-stop-using-timespec-based-interfaces.patch
reiserfs-use-monotonic-time-for-j_trans_start_time.patch
reiserfs-remove-obsolete-print_time-function.patch
reiserfs-change-j_timestamp-type-to-time64_t.patch
fat-propagate-64-bit-inode-timestamps.patch
adfs-use-timespec64-for-time-conversion.patch
vmcore-hide-vmcoredd_mmap_dumps-for-nommu-builds.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux