diff options
author | Christian Brauner <brauner@kernel.org> | 2023-08-07 15:26:19 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2023-11-03 23:28:34 +0100 |
commit | 09838f1bfd40f483cd6442788e810ea042e91177 (patch) | |
tree | 824812dbbeeaed2ee13e7cf48fc2298569fe5c59 /fs | |
parent | 673478b6e59b25079a590eb5ba89d7a3ec9c1c78 (diff) | |
download | linux-stable-09838f1bfd40f483cd6442788e810ea042e91177.tar.gz linux-stable-09838f1bfd40f483cd6442788e810ea042e91177.tar.bz2 linux-stable-09838f1bfd40f483cd6442788e810ea042e91177.zip |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/dir.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 6bb95b4e93a8..91709934c8b1 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -953,6 +953,7 @@ static int ceph_mknod(struct mnt_idmap *idmap, struct inode *dir, req->r_parent = dir; ihold(dir); set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); + req->r_mnt_idmap = mnt_idmap_get(idmap); req->r_args.mknod.mode = cpu_to_le32(mode); req->r_args.mknod.rdev = cpu_to_le32(rdev); 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, } set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); + req->r_mnt_idmap = mnt_idmap_get(idmap); req->r_dentry = dget(dentry); req->r_num_caps = 2; 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, req->r_parent = dir; ihold(dir); set_bit(CEPH_MDS_R_PARENT_LOCKED, &req->r_req_flags); + if (op == CEPH_MDS_OP_MKDIR) + req->r_mnt_idmap = mnt_idmap_get(idmap); req->r_args.mkdir.mode = cpu_to_le32(mode); req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL | CEPH_CAP_XATTR_EXCL; |