Skip to content

Commit 09838f1

Browse files
brauneridryomov
authored andcommitted
ceph: pass an idmapping to mknod/symlink/mkdir
Enable mknod/symlink/mkdir iops to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Reviewed-by: Xiubo Li <xiubli@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 673478b commit 09838f1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/ceph/dir.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ static int ceph_mknod(struct mnt_idmap *idmap, struct inode *dir,
953953
req->r_parent = dir;
954954
ihold(dir);
955955
set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags);
956+
req->r_mnt_idmap = mnt_idmap_get(idmap);
956957
req->r_args.mknod.mode = cpu_to_le32(mode);
957958
req->r_args.mknod.rdev = cpu_to_le32(rdev);
958959
req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL |
@@ -1071,6 +1072,7 @@ static int ceph_symlink(struct mnt_idmap *idmap, struct inode *dir,
10711072
}
10721073

10731074
set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags);
1075+
req->r_mnt_idmap = mnt_idmap_get(idmap);
10741076
req->r_dentry = dget(dentry);
10751077
req->r_num_caps = 2;
10761078
req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL |
@@ -1150,6 +1152,8 @@ static int ceph_mkdir(struct mnt_idmap *idmap, struct inode *dir,
11501152
req->r_parent = dir;
11511153
ihold(dir);
11521154
set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags);
1155+
if (op == CEPH_MDS_OP_MKDIR)
1156+
req->r_mnt_idmap = mnt_idmap_get(idmap);
11531157
req->r_args.mkdir.mode = cpu_to_le32(mode);
11541158
req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL |
11551159
CEPH_CAP_XATTR_EXCL;

0 commit comments

Comments
 (0)