diff mbox series

[02/58] xfs: ensure that the inode uid/gid match values match the icdinode ones

Message ID 20200507121851.304002-3-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/58] xfs: add agf freeblocks verify in xfs_agf_verify | expand

Commit Message

Christoph Hellwig May 7, 2020, 12:17 p.m. UTC
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@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/xfs_inode.h    | 5 +++++
 libxfs/xfs_inode_buf.c | 2 ++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

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);
 
 	/*