]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: ensure that the inode uid/gid match values match the icdinode ones
authorChristoph Hellwig <hch@lst.de>
Wed, 29 Apr 2020 18:10:49 +0000 (14:10 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 29 Apr 2020 18:10:49 +0000 (14:10 -0400)
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: Eric Sandeen <sandeen@sandeen.net>
include/xfs_inode.h
libxfs/libxfs_priv.h
libxfs/xfs_inode_buf.c

index e95a4959e76a80133ea7b90841d5763ba716d131..5e889503ebac48a49231e31c0b1697865c84c770 100644 (file)
@@ -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 */
index 68b6c0f0fcf7d5a87a526a2c47b971af4956eccb..9ef5027010edddec2d3e478045ec1305a344c06f 100644 (file)
@@ -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.
index c0cb56763716a70f8f70f10dafa5677a98a58d9b..a7d39f24592a2349989cf0a3f5d555b1fab543a1 100644 (file)
@@ -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);
 
        /*