Skip to contentSkip to conversation

jfs: use time64_t for otime

PATCH In review Arnd Bergmann 2 participants 2 messages Jun 19, 2018 JFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jfs: use time64_t for otime

The file creation time in the inode uses time_t which is defined differently on 32-bit and 64-bit architectures and deprecated. The representation in the inode uses an unsigned 32-bit number, but this gets wrapped around after year 2038 when assigned to a time_t.

This changes the type to time64_t, so we can support the full range of timestamps between 1970 and 2106 on 32-bit systems like we do on 64-bit systems already, and matching what we do for the atime/ctime/mtime stamps since the introduction of 64-bit timestamps in VFS.

Note: the otime stamp is not actually used anywhere at the moment in the kernel, it is just set when writing a file, so none of this really makes a difference unless we implement setting the btime field in the getattr() callback.

---
 fs/jfs/jfs_incore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/jfs_incore.h +1 -1
index 1f26d1910409..d5c46f86b2ef 100644
@@ -43,7 +43,7 @@ struct jfs_inode_info {
 	pxd_t	ixpxd;		/* inode extent descriptor	*/
 	dxd_t	acl;		/* dxd describing acl	*/
 	dxd_t	ea;		/* dxd describing ea	*/
-	time_t	otime;		/* time created	*/
+	time64_t otime;		/* time created	*/
 	uint	next_index;	/* next available directory entry index */
 	int	acltype;	/* Type of ACL	*/
 	short	btorder;	/* access order	*/
Signature · 1 line
2.9.0
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The file creation time in the inode uses time_t which is defined differently on 32-bit and 64-bit architectures and deprecated. The representation in the inode uses an unsigned 32-bit number, but this gets wrapped around after year 2038 when assigned to a time_t.

This changes the type to time64_t, so we can support the full range of timestamps between 1970 and 2106 on 32-bit systems like we do on 64-bit systems already, and matching what we do for the atime/ctime/mtime stamps since the introduction of 64-bit timestamps in VFS.

Quoted 4 lines

Note: the otime stamp is not actually used anywhere at the moment in the kernel, it is just set when writing a file, so none of this really makes a difference unless we implement setting the btime field in the getattr() callback.

This looks good to me. I'll push it to linux-next and target the next merge window.

Thanks,
Shaggy

Quoted 20 lines
---
 fs/jfs/jfs_incore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/jfs_incore.h +1 -1
index 1f26d1910409..d5c46f86b2ef 100644
@@ -43,7 +43,7 @@ struct jfs_inode_info {
 	pxd_t	ixpxd;		/* inode extent descriptor	*/
 	dxd_t	acl;		/* dxd describing acl	*/
 	dxd_t	ea;		/* dxd describing ea	*/
-	time_t	otime;		/* time created	*/
+	time64_t otime;		/* time created	*/
 	uint	next_index;	/* next available directory entry index */
 	int	acltype;	/* Type of ACL	*/
 	short	btorder;	/* access order	*/