summaryrefslogtreecommitdiffstats
path: root/fs/ksmbd/smbacl.h
diff options
context:
space:
mode:
authorChristian Brauner <christian.brauner@ubuntu.com>2021-12-03 12:17:03 +0100
committerChristian Brauner <christian.brauner@ubuntu.com>2021-12-03 18:58:11 +0100
commit4472071331549e911a5abad41aea6e3be855a1a4 (patch)
tree6da51e76328b10a835c33f6f916a671a12274e5d /fs/ksmbd/smbacl.h
parent8cc5c54de44c5e8e104d364a627ac4296845fc7f (diff)
downloadlinux-stable-4472071331549e911a5abad41aea6e3be855a1a4.tar.gz
linux-stable-4472071331549e911a5abad41aea6e3be855a1a4.tar.bz2
linux-stable-4472071331549e911a5abad41aea6e3be855a1a4.zip
fs: use low-level mapping helpers
In a few places the vfs needs to interact with bare k{g,u}ids directly instead of struct inode. These are just a few. In previous patches we introduced low-level mapping helpers that are able to support filesystems mounted an idmapping. This patch simply converts the places to use these new helpers. Link: https://lore.kernel.org/r/20211123114227.3124056-7-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-7-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-7-brauner@kernel.org Cc: Seth Forshee <sforshee@digitalocean.com> Cc: Amir Goldstein <amir73il@gmail.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@zeniv.linux.org.uk> CC: linux-fsdevel@vger.kernel.org Reviewed-by: Seth Forshee <sforshee@digitalocean.com> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'fs/ksmbd/smbacl.h')
-rw-r--r--fs/ksmbd/smbacl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ksmbd/smbacl.h b/fs/ksmbd/smbacl.h
index eba1ebb9e92e..811af3309429 100644
--- a/fs/ksmbd/smbacl.h
+++ b/fs/ksmbd/smbacl.h
@@ -217,7 +217,7 @@ static inline uid_t posix_acl_uid_translate(struct user_namespace *mnt_userns,
kuid_t kuid;
/* If this is an idmapped mount, apply the idmapping. */
- kuid = kuid_into_mnt(mnt_userns, pace->e_uid);
+ kuid = mapped_kuid_fs(mnt_userns, &init_user_ns, pace->e_uid);
/* Translate the kuid into a userspace id ksmbd would see. */
return from_kuid(&init_user_ns, kuid);
@@ -229,7 +229,7 @@ static inline gid_t posix_acl_gid_translate(struct user_namespace *mnt_userns,
kgid_t kgid;
/* If this is an idmapped mount, apply the idmapping. */
- kgid = kgid_into_mnt(mnt_userns, pace->e_gid);
+ kgid = mapped_kgid_fs(mnt_userns, &init_user_ns, pace->e_gid);
/* Translate the kgid into a userspace id ksmbd would see. */
return from_kgid(&init_user_ns, kgid);