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

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