mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
fs: port xattr to mnt_idmap
Convert to struct mnt_idmap.
Last cycle we merged the necessary infrastructure in
256c8aed2b ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.
Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.
Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner (Microsoft)
parent
4609e1f18e
commit
39f60c1cce
@@ -42,7 +42,7 @@ struct xattr_handler {
|
||||
struct inode *inode, const char *name, void *buffer,
|
||||
size_t size);
|
||||
int (*set)(const struct xattr_handler *,
|
||||
struct user_namespace *mnt_userns, struct dentry *dentry,
|
||||
struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
struct inode *inode, const char *name, const void *buffer,
|
||||
size_t size, int flags);
|
||||
};
|
||||
@@ -59,16 +59,16 @@ ssize_t __vfs_getxattr(struct dentry *, struct inode *, const char *, void *, si
|
||||
ssize_t vfs_getxattr(struct mnt_idmap *, struct dentry *, const char *,
|
||||
void *, size_t);
|
||||
ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
|
||||
int __vfs_setxattr(struct user_namespace *, struct dentry *, struct inode *,
|
||||
int __vfs_setxattr(struct mnt_idmap *, struct dentry *, struct inode *,
|
||||
const char *, const void *, size_t, int);
|
||||
int __vfs_setxattr_noperm(struct user_namespace *, struct dentry *,
|
||||
int __vfs_setxattr_noperm(struct mnt_idmap *, struct dentry *,
|
||||
const char *, const void *, size_t, int);
|
||||
int __vfs_setxattr_locked(struct mnt_idmap *, struct dentry *,
|
||||
const char *, const void *, size_t, int,
|
||||
struct inode **);
|
||||
int vfs_setxattr(struct mnt_idmap *, struct dentry *, const char *,
|
||||
const void *, size_t, int);
|
||||
int __vfs_removexattr(struct user_namespace *, struct dentry *, const char *);
|
||||
int __vfs_removexattr(struct mnt_idmap *, struct dentry *, const char *);
|
||||
int __vfs_removexattr_locked(struct mnt_idmap *, struct dentry *,
|
||||
const char *, struct inode **);
|
||||
int vfs_removexattr(struct mnt_idmap *, struct dentry *, const char *);
|
||||
|
||||
Reference in New Issue
Block a user