提交 bd2bae6a 编写于 作者: E Eric W. Biederman

ceph: Convert kuids and kgids before printing them.

Before printing kuid and kgids values convert them into
the initial user namespace.

Cc: Sage Weil <sage@inktank.com>
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
上级 ff3d0046
...@@ -2362,7 +2362,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant, ...@@ -2362,7 +2362,8 @@ static void handle_cap_grant(struct inode *inode, struct ceph_mds_caps *grant,
inode->i_uid = make_kuid(&init_user_ns, le32_to_cpu(grant->uid)); inode->i_uid = make_kuid(&init_user_ns, le32_to_cpu(grant->uid));
inode->i_gid = make_kgid(&init_user_ns, le32_to_cpu(grant->gid)); inode->i_gid = make_kgid(&init_user_ns, le32_to_cpu(grant->gid));
dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode, dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode,
inode->i_uid, inode->i_gid); from_kuid(&init_user_ns, inode->i_uid),
from_kgid(&init_user_ns, inode->i_gid));
} }
if ((issued & CEPH_CAP_LINK_EXCL) == 0) if ((issued & CEPH_CAP_LINK_EXCL) == 0)
......
...@@ -615,7 +615,8 @@ static int fill_inode(struct inode *inode, ...@@ -615,7 +615,8 @@ static int fill_inode(struct inode *inode,
inode->i_uid = make_kuid(&init_user_ns, le32_to_cpu(info->uid)); inode->i_uid = make_kuid(&init_user_ns, le32_to_cpu(info->uid));
inode->i_gid = make_kgid(&init_user_ns, le32_to_cpu(info->gid)); inode->i_gid = make_kgid(&init_user_ns, le32_to_cpu(info->gid));
dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode, dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode,
inode->i_uid, inode->i_gid); from_kuid(&init_user_ns, inode->i_uid),
from_kgid(&init_user_ns, inode->i_gid));
} }
if ((issued & CEPH_CAP_LINK_EXCL) == 0) if ((issued & CEPH_CAP_LINK_EXCL) == 0)
...@@ -1565,7 +1566,8 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1565,7 +1566,8 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
if (ia_valid & ATTR_UID) { if (ia_valid & ATTR_UID) {
dout("setattr %p uid %d -> %d\n", inode, dout("setattr %p uid %d -> %d\n", inode,
inode->i_uid, attr->ia_uid); from_kuid(&init_user_ns, inode->i_uid),
from_kuid(&init_user_ns, attr->ia_uid));
if (issued & CEPH_CAP_AUTH_EXCL) { if (issued & CEPH_CAP_AUTH_EXCL) {
inode->i_uid = attr->ia_uid; inode->i_uid = attr->ia_uid;
dirtied |= CEPH_CAP_AUTH_EXCL; dirtied |= CEPH_CAP_AUTH_EXCL;
...@@ -1579,7 +1581,8 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -1579,7 +1581,8 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
} }
if (ia_valid & ATTR_GID) { if (ia_valid & ATTR_GID) {
dout("setattr %p gid %d -> %d\n", inode, dout("setattr %p gid %d -> %d\n", inode,
inode->i_gid, attr->ia_gid); from_kgid(&init_user_ns, inode->i_gid),
from_kgid(&init_user_ns, attr->ia_gid));
if (issued & CEPH_CAP_AUTH_EXCL) { if (issued & CEPH_CAP_AUTH_EXCL) {
inode->i_gid = attr->ia_gid; inode->i_gid = attr->ia_gid;
dirtied |= CEPH_CAP_AUTH_EXCL; dirtied |= CEPH_CAP_AUTH_EXCL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册