ceph: fix uid/gid on resent mds requests

MDS requests can be rebuilt and resent in non-process context, but were
filling in uid/gid from current_fsuid/gid. Put that information in the
request struct on request setup.

This fixes incorrect (and root) uid/gid getting set for requests that
are forwarded between MDSs, usually due to metadata migrations.

Signed-off-by: Sage Weil <sage@newdream.net>

Sage Weil cb4276cc cd045cb4

+7 -2
+5 -2
fs/ceph/mds_client.c
··· 529 529 ceph_mdsc_get_request(req); 530 530 __insert_request(mdsc, req); 531 531 532 + req->r_uid = current_fsuid(); 533 + req->r_gid = current_fsgid(); 534 + 532 535 if (dir) { 533 536 struct ceph_inode_info *ci = ceph_inode(dir); 534 537 ··· 1591 1588 1592 1589 head->mdsmap_epoch = cpu_to_le32(mdsc->mdsmap->m_epoch); 1593 1590 head->op = cpu_to_le32(req->r_op); 1594 - head->caller_uid = cpu_to_le32(current_fsuid()); 1595 - head->caller_gid = cpu_to_le32(current_fsgid()); 1591 + head->caller_uid = cpu_to_le32(req->r_uid); 1592 + head->caller_gid = cpu_to_le32(req->r_gid); 1596 1593 head->args = req->r_args; 1597 1594 1598 1595 ceph_encode_filepath(&p, end, ino1, path1);
+2
fs/ceph/mds_client.h
··· 170 170 171 171 union ceph_mds_request_args r_args; 172 172 int r_fmode; /* file mode, if expecting cap */ 173 + uid_t r_uid; 174 + gid_t r_gid; 173 175 174 176 /* for choosing which mds to send this request to */ 175 177 int r_direct_mode;