Skip to contentSkip to conversation

xfs: change the seconds fields in xfs_bulkstat to signed

PATCH In review Darrick J. Wong 3 participants 4 messages Oct 14, 2019 – Oct 15, 2019 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: change the seconds fields in xfs_bulkstat to signed

From: Darrick J. Wong <[email protected]>

64-bit time is a signed quantity in the kernel, so the bulkstat structure should reflect that.

---
 fs/xfs/libxfs/xfs_fs.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/xfs/libxfs/xfs_fs.h +4 -4
index b0c884e80915..8b77eace70f1 100644
@@ -368,11 +368,11 @@ struct xfs_bulkstat {
 	uint64_t	bs_blocks;	/* number of blocks		*/
 	uint64_t	bs_xflags;	/* extended flags		*/
 
-	uint64_t	bs_atime;	/* access time, seconds		*/
-	uint64_t	bs_mtime;	/* modify time, seconds		*/
+	int64_t		bs_atime;	/* access time, seconds		*/
+	int64_t		bs_mtime;	/* modify time, seconds		*/
 
-	uint64_t	bs_ctime;	/* inode change time, seconds	*/
-	uint64_t	bs_btime;	/* creation time, seconds	*/
+	int64_t		bs_ctime;	/* inode change time, seconds	*/
+	int64_t		bs_btime;	/* creation time, seconds	*/
 
 	uint32_t	bs_gen;		/* generation count		*/
 	uint32_t	bs_uid;		/* user id			*/
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

64-bit time is a signed quantity in the kernel, so the bulkstat structure should reflect that.

Quoted 24 lines
---
 fs/xfs/libxfs/xfs_fs.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
fs/xfs/libxfs/xfs_fs.h +4 -4
index b0c884e80915..8b77eace70f1 100644
@@ -368,11 +368,11 @@ struct xfs_bulkstat {
 	uint64_t	bs_blocks;	/* number of blocks		*/
 	uint64_t	bs_xflags;	/* extended flags		*/
 
-	uint64_t	bs_atime;	/* access time, seconds		*/
-	uint64_t	bs_mtime;	/* modify time, seconds		*/
+	int64_t		bs_atime;	/* access time, seconds		*/
+	int64_t		bs_mtime;	/* modify time, seconds		*/
 
-	uint64_t	bs_ctime;	/* inode change time, seconds	*/
-	uint64_t	bs_btime;	/* creation time, seconds	*/
+	int64_t		bs_ctime;	/* inode change time, seconds	*/
+	int64_t		bs_btime;	/* creation time, seconds	*/
 
 	uint32_t	bs_gen;		/* generation count		*/
 	uint32_t	bs_uid;		/* user id			*/
Signature · 1 line
Carlos
#3 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

64-bit time is a signed quantity in the kernel, so the bulkstat structure should reflect that.

Strictly speaking this is a break of the userspace API, but I can't see how it causes problems in practice, so:

Yeah, I think I'll add a note to the changelog:

"Note that the structure size stays the same and that we have not yet published userspace headers for this new ioctl so there are no users to break."

Quoted 1 line