Source kernel commit: 3d8f2821502d0b60bac2789d0bea951fda61de0c Instead of only synchronizing the uid/gid values in xfs_setup_inode, ensure that they always match to prepare for removing the icdinode fields. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- include/xfs_inode.h | 5 +++++ libxfs/xfs_inode_buf.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/xfs_inode.h b/include/xfs_inode.h index e95a4959..5cb5a87b 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -34,6 +34,8 @@ struct xfs_dir_ops; struct inode { mode_t i_mode; uint32_t i_nlink; + uint32_t i_uid; + uint32_t i_gid; xfs_dev_t i_rdev; /* This actually holds xfs_dev_t */ unsigned long i_state; /* Not actually used in userspace */ uint32_t i_generation; @@ -43,6 +45,9 @@ struct inode { struct timespec i_ctime; }; +#define xfs_uid_to_kuid(uid) (uid) +#define xfs_gid_to_kgid(gid) (gid) + typedef struct xfs_inode { struct cache_node i_node; struct xfs_mount *i_mount; /* fs mount struct ptr */ diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index c0cb5676..a7d39f24 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -220,7 +220,9 @@ xfs_inode_from_disk( to->di_format = from->di_format; to->di_uid = be32_to_cpu(from->di_uid); + inode->i_uid = xfs_uid_to_kuid(to->di_uid); to->di_gid = be32_to_cpu(from->di_gid); + inode->i_gid = xfs_gid_to_kgid(to->di_gid); to->di_flushiter = be16_to_cpu(from->di_flushiter); /* -- 2.26.2