Linux 3.8 compat: Support CONFIG_UIDGID_STRICT_TYPE_CHECKS

When CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled uid_t/git_t are
replaced by kuid_t/kgid_t, which are structures instead of integral
types. This causes any code that uses an integral type to fail to build.
The User Namespace functionality introduced in Linux 3.8 requires
CONFIG_UIDGID_STRICT_TYPE_CHECKS, so we could not build against any
kernel that supported it.

We resolve this by converting between the new kuid_t/kgid_t structures
and the original uid_t/gid_t types.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1589
This commit is contained in:
Richard Yao
2013-07-14 12:59:24 -04:00
committed by Brian Behlendorf
parent fadd0c4da1
commit 570d6edf1d
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -472,8 +472,8 @@ zfs_inode_update(znode_t *zp)
spin_lock(&ip->i_lock);
ip->i_generation = zp->z_gen;
ip->i_uid = zp->z_uid;
ip->i_gid = zp->z_gid;
ip->i_uid = SUID_TO_KUID(zp->z_uid);
ip->i_gid = SGID_TO_KGID(zp->z_gid);
set_nlink(ip, zp->z_links);
ip->i_mode = zp->z_mode;
ip->i_blkbits = SPA_MINBLOCKSHIFT;