summaryrefslogtreecommitdiffstats
path: root/module/zfs/zpl_inode.c
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2013-07-14 12:59:24 -0400
committerBrian Behlendorf <[email protected]>2013-08-09 15:31:52 -0700
commit570d6edf1d94917aab49c5755027d05b3c7bcd43 (patch)
tree979e02ad02f201bec3d4ad1c23ffb828e463fdbc /module/zfs/zpl_inode.c
parentfadd0c4da1e2ccd6014800d8b1a0fd117dd323e8 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1589
Diffstat (limited to 'module/zfs/zpl_inode.c')
-rw-r--r--module/zfs/zpl_inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
index 8c8ec2414..ab1fe6823 100644
--- a/module/zfs/zpl_inode.c
+++ b/module/zfs/zpl_inode.c
@@ -74,7 +74,7 @@ zpl_vap_init(vattr_t *vap, struct inode *dir, zpl_umode_t mode, cred_t *cr)
vap->va_uid = crgetfsuid(cr);
if (dir && dir->i_mode & S_ISGID) {
- vap->va_gid = dir->i_gid;
+ vap->va_gid = KGID_TO_SGID(dir->i_gid);
if (S_ISDIR(mode))
vap->va_mode |= S_ISGID;
} else {
@@ -235,8 +235,8 @@ zpl_setattr(struct dentry *dentry, struct iattr *ia)
vap = kmem_zalloc(sizeof(vattr_t), KM_SLEEP);
vap->va_mask = ia->ia_valid & ATTR_IATTR_MASK;
vap->va_mode = ia->ia_mode;
- vap->va_uid = ia->ia_uid;
- vap->va_gid = ia->ia_gid;
+ vap->va_uid = KUID_TO_SUID(ia->ia_uid);
+ vap->va_gid = KGID_TO_SGID(ia->ia_gid);
vap->va_size = ia->ia_size;
vap->va_atime = ia->ia_atime;
vap->va_mtime = ia->ia_mtime;