Skip to content

Commit

Permalink
ceph: Convert struct ceph_mds_request to use kuid_t and kgid_t
Browse files Browse the repository at this point in the history
Hold the uid and gid for a pending ceph mds request using the types
kuid_t and kgid_t.  When a request message is finally created convert
the kuid_t and kgid_t values into uids and gids in the initial user
namespace.

Cc: Sage Weil <sage@inktank.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Feb 12, 2013
1 parent ab871b9 commit ff3d004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,8 +1658,8 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,

head->mdsmap_epoch = cpu_to_le32(mdsc->mdsmap->m_epoch);
head->op = cpu_to_le32(req->r_op);
head->caller_uid = cpu_to_le32(req->r_uid);
head->caller_gid = cpu_to_le32(req->r_gid);
head->caller_uid = cpu_to_le32(from_kuid(&init_user_ns, req->r_uid));
head->caller_gid = cpu_to_le32(from_kgid(&init_user_ns, req->r_gid));
head->args = req->r_args;

ceph_encode_filepath(&p, end, ino1, path1);
Expand Down
4 changes: 2 additions & 2 deletions fs/ceph/mds_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ struct ceph_mds_request {

union ceph_mds_request_args r_args;
int r_fmode; /* file mode, if expecting cap */
uid_t r_uid;
gid_t r_gid;
kuid_t r_uid;
kgid_t r_gid;

/* for choosing which mds to send this request to */
int r_direct_mode;
Expand Down

0 comments on commit ff3d004

Please sign in to comment.