From: Christoph Hellwig Date: Wed, 29 Apr 2020 18:10:49 +0000 (-0400) Subject: xfs: ensure that the inode uid/gid match values match the icdinode ones X-Git-Tag: v5.7.0-rc0~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b12dd5f3f56d246024c3a9fadd81701ab9771731;p=thirdparty%2Fxfsprogs-dev.git xfs: ensure that the inode uid/gid match values match the icdinode ones 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 Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/include/xfs_inode.h b/include/xfs_inode.h index e95a4959e..5e889503e 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -33,6 +33,8 @@ struct xfs_dir_ops; */ struct inode { mode_t i_mode; + uint32_t i_uid; + uint32_t i_gid; uint32_t i_nlink; xfs_dev_t i_rdev; /* This actually holds xfs_dev_t */ unsigned long i_state; /* Not actually used in userspace */ diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 68b6c0f0f..9ef502701 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -458,6 +458,9 @@ static inline struct xfs_buf *xfs_buf_incore(struct xfs_buftarg *target, #define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0) #define xfs_sb_validate_fsb_count(sbp, nblks) (0) +#define xfs_uid_to_kuid(uid) (uid) +#define xfs_gid_to_kgid(gid) (gid) + /* * Prototypes for kernel static functions that are aren't in their * associated header files. diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index c0cb56763..a7d39f245 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); /*