Blame SOURCES/xfsprogs-5.12.0-libxfs-copy-crtime-correctly-now-that-it-s-timespec6.patch

5d5cbe
From d625f74125863304d111f5c6a0817a115f8e502d Mon Sep 17 00:00:00 2001
5d5cbe
From: "Darrick J. Wong" <djwong@kernel.org>
5d5cbe
Date: Fri, 7 May 2021 10:42:17 -0400
5d5cbe
Subject: [PATCH] libxfs: copy crtime correctly now that it's timespec64
5d5cbe
5d5cbe
The incore i_mtime and di_crtime are both timespec64 now, which means
5d5cbe
that tv_sec is a 64-bit value.  Don't cast that to int32_t when we're
5d5cbe
creating an inode, because we'll end up truncating the creation time
5d5cbe
incorrectly, should an xfsprogs of this vintage make it to 2039. :P
5d5cbe
5d5cbe
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
5d5cbe
Reviewed-by: Christoph Hellwig <hch@lst.de>
5d5cbe
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
5d5cbe
---
5d5cbe
5d5cbe
diff --git a/libxfs/util.c b/libxfs/util.c
5d5cbe
index 7a8729f..fd4906f 100644
5d5cbe
--- a/libxfs/util.c
5d5cbe
+++ b/libxfs/util.c
5d5cbe
@@ -326,8 +326,7 @@ libxfs_ialloc(
5d5cbe
 			ip->i_d.di_flags2 = xfs_flags2diflags2(ip, fsx->fsx_xflags);
5d5cbe
 		}
5d5cbe
 
5d5cbe
-		ip->i_d.di_crtime.tv_sec = (int32_t)VFS_I(ip)->i_mtime.tv_sec;
5d5cbe
-		ip->i_d.di_crtime.tv_nsec = (int32_t)VFS_I(ip)->i_mtime.tv_nsec;
5d5cbe
+		ip->i_d.di_crtime = VFS_I(ip)->i_mtime; /* struct copy */
5d5cbe
 		ip->i_d.di_cowextsize = pip ? 0 : fsx->fsx_cowextsize;
5d5cbe
 	}
5d5cbe