aufs6.x-rcN kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
-index 2685a4d0d353..a2df3d4bb3aa 100644
+index cc07a0cd3172..5ee4f1be48ff 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
-@@ -319,6 +319,7 @@ source "fs/sysv/Kconfig"
+@@ -316,6 +316,7 @@ source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
source "fs/erofs/Kconfig"
source "fs/vboxsf/Kconfig"
endif # MISC_FILESYSTEMS
diff --git a/fs/Makefile b/fs/Makefile
-index 4dea17840761..9795cbfdd0bf 100644
+index 834f1c3dba46..b5c97dd026cd 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -137,3 +137,4 @@ obj-$(CONFIG_EFIVAR_FS) += efivarfs/
aufs6.x-rcN base patch
diff --git a/MAINTAINERS b/MAINTAINERS
-index f61eb221415b..b192cff97244 100644
+index 7e0b87d5aa2e..ce2984ca2f06 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -3522,6 +3522,19 @@ F: include/uapi/linux/audit.h
+@@ -3387,6 +3387,19 @@ F: include/uapi/linux/audit.h
F: kernel/audit*
F: lib/*audit.c
M: Miguel Ojeda <ojeda@kernel.org>
S: Maintained
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 1518a6423279..7a9928c6db9d 100644
+index bc31bb7072a2..131294601819 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -645,6 +645,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
{
struct dentry *this_parent;
diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 146c9ab0cd4b..c980a0524118 100644
+index b622be119706..9ea58b7bb580 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
-@@ -33,7 +33,7 @@
+@@ -34,7 +34,7 @@
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
{
struct inode * inode = file_inode(filp);
int error = 0;
-@@ -63,6 +63,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
+@@ -64,6 +64,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
if (filp->f_op->check_flags)
error = filp->f_op->check_flags(arg);
return error;
diff --git a/fs/namespace.c b/fs/namespace.c
-index ab467ee58341..8cd34f760f63 100644
+index 54847db5b819..ebb7b4b057ea 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -963,6 +963,12 @@ static inline int check_mnt(struct mount *mnt)
+@@ -849,6 +849,12 @@ static inline int check_mnt(struct mount *mnt)
return mnt->mnt_ns == current->nsproxy->mnt_ns;
}
* vfsmount lock must be held for write
*/
diff --git a/fs/splice.c b/fs/splice.c
-index 5969b7a1d353..21db9b057d60 100644
+index 3e06611d19ae..97a66df75d4c 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -756,8 +756,8 @@ static int warn_unsupported(struct file *file, const char *op)
+@@ -865,8 +865,8 @@ static int warn_unsupported(struct file *file, const char *op)
/*
* Attempt to initiate a splice from pipe to file.
*/
{
if (unlikely(!out->f_op->splice_write))
return warn_unsupported(out, "write");
-@@ -767,9 +767,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -876,9 +876,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
/*
* Attempt to initiate a splice from a file to a pipe.
*/
unsigned int p_space;
int ret;
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 066555ad1bf8..2d30def9a580 100644
+index 21a981680856..1e3054e5367d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -1383,6 +1383,7 @@ extern void fasync_free(struct fasync_struct *);
+@@ -1066,6 +1066,7 @@ extern void fasync_free(struct fasync_struct *);
/* can be called from interrupts */
extern void kill_fasync(struct fasync_struct **, int, int);
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
extern int f_setown(struct file *filp, unsigned long arg, int force);
extern void f_delown(struct file *filp);
-@@ -2110,6 +2111,7 @@ struct file_operations {
+@@ -1793,6 +1794,7 @@ struct file_operations {
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
-index 1f1099dac3f0..81d10b8e9dc0 100644
+index b32256e9e944..16bd7230f44b 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
-@@ -248,6 +248,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
+@@ -249,6 +249,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
return lock->key == key;
}
+ unsigned int flags);
#endif
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
-index e3375bc40dad..c1f0aadde539 100644
+index dcd1d5bfc1e0..85d1f7e0bc07 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
-@@ -217,7 +217,7 @@ unsigned long max_lock_class_idx;
+@@ -218,7 +218,7 @@ unsigned long max_lock_class_idx;
struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
{
unsigned int class_idx = hlock->class_idx;
-@@ -238,6 +238,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
+@@ -239,6 +239,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
*/
return lock_classes + class_idx;
}
aufs6.x-rcN mmap patch
diff --git a/fs/proc/base.c b/fs/proc/base.c
-index 9e479d7d202b..986c2ae12f8b 100644
+index 05452c3b9872..6b92a8430130 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2218,7 +2218,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
ino = inode->i_ino;
}
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index e35a0398db63..d9080329fd7a 100644
+index 420510f6a545..edfc0941806a 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -285,7 +285,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
dev = inode->i_sb->s_dev;
ino = inode->i_ino;
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
-@@ -1942,7 +1945,7 @@ static int show_numa_map(struct seq_file *m, void *v)
+@@ -1943,7 +1946,7 @@ static int show_numa_map(struct seq_file *m, void *v)
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
struct vm_area_struct *vma = v;
struct numa_maps *md = &numa_priv->md;
struct mempolicy *pol;
char buffer[64];
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
-index 2fd06f52b6a4..b01030da424f 100644
+index 0ec35072a8e5..f0f0a03eb2b5 100644
--- a/fs/proc/task_nommu.c
+++ b/fs/proc/task_nommu.c
@@ -150,7 +150,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
ino = inode->i_ino;
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index f3f196e4d66d..831812fd4d07 100644
+index 27ce77080c79..5f07b972242d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
-@@ -2059,6 +2059,43 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
+@@ -2353,6 +2353,43 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
unmap_mapping_range(mapping, holebegin, holelen, 0);
}
-+#if IS_ENABLED(CONFIG_AUFS_FS)
++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int);
+extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[],
+ int);
void *buf, int len, unsigned int gup_flags);
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
-index 3b8475007734..7a2de3f818bc 100644
+index 306a3d1a0fa6..56374f0eb825 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
-@@ -504,6 +504,9 @@ struct vm_region {
+@@ -449,6 +449,9 @@ struct vm_region {
unsigned long vm_top; /* region allocated to here */
unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */
struct file *vm_file; /* the backing file or NULL */
-+#if IS_ENABLED(CONFIG_AUFS_FS)
++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ struct file *vm_prfile; /* the virtual backing file or NULL */
+#endif
int vm_usage; /* region usage count (access under nommu_region_sem) */
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
-@@ -575,6 +578,9 @@ struct vm_area_struct {
+@@ -548,6 +551,9 @@ struct vm_area_struct {
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
units */
struct file * vm_file; /* File we map to (can be NULL). */
-+#if IS_ENABLED(CONFIG_AUFS_FS)
++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ struct file *vm_prfile; /* shadow of vm_file */
+#endif
void * vm_private_data; /* was vm_pte (shared mem) */
#ifdef CONFIG_ANON_VMA_NAME
diff --git a/kernel/fork.c b/kernel/fork.c
-index 9f7fe3541897..f9e44ca88a7d 100644
+index ed4e01daccaa..e945a1639283 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
-@@ -664,7 +664,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
+@@ -733,7 +733,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
if (file) {
struct address_space *mapping = file->f_mapping;
if (tmp->vm_flags & VM_SHARED)
mapping_allow_writable(mapping);
diff --git a/mm/Makefile b/mm/Makefile
-index 8e105e5b3e29..c218d042dbce 100644
+index e29afc890cde..c467601299d4 100644
--- a/mm/Makefile
+++ b/mm/Makefile
-@@ -138,3 +138,4 @@ obj-$(CONFIG_IO_MAPPING) += io-mapping.o
+@@ -137,3 +137,4 @@ obj-$(CONFIG_IO_MAPPING) += io-mapping.o
obj-$(CONFIG_HAVE_BOOTMEM_INFO_NODE) += bootmem_info.o
obj-$(CONFIG_GENERIC_IOREMAP) += ioremap.o
obj-$(CONFIG_SHRINKER_DEBUG) += shrinker_debug.o
-+obj-$(CONFIG_AUFS_FS:m=y) += prfile.o
++obj-y += prfile.o
diff --git a/mm/filemap.c b/mm/filemap.c
-index c4d4ace9cc70..257da81286d1 100644
+index b4c9bd368b7e..ec4f4e5c1a92 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
-@@ -3437,7 +3437,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
+@@ -3564,7 +3564,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
vm_fault_t ret = VM_FAULT_LOCKED;
sb_start_pagefault(mapping->host->i_sb);
if (folio->mapping != mapping) {
folio_unlock(folio);
diff --git a/mm/mmap.c b/mm/mmap.c
-index 87d929316d57..fac904cd41cd 100644
+index 13678edaa22c..4de00f38822c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
-@@ -139,7 +139,7 @@ static void remove_vma(struct vm_area_struct *vma)
+@@ -140,7 +140,7 @@ static void remove_vma(struct vm_area_struct *vma, bool unreachable)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
- fput(vma->vm_file);
+ vma_fput(vma);
mpol_put(vma_policy(vma));
- vm_area_free(vma);
- }
-@@ -589,7 +589,7 @@ inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
- if (remove_next) {
- if (file) {
- uprobe_munmap(next, next->vm_start, next->vm_end);
-- fput(file);
-+ vma_fput(vma);
- }
- if (next->anon_vma)
- anon_vma_merge(vma, next);
-@@ -830,7 +830,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
- again:
- if (file) {
- uprobe_munmap(next, next->vm_start, next->vm_end);
-- fput(file);
-+ vma_fput(vma);
- }
- if (next->anon_vma)
- anon_vma_merge(vma, next);
-@@ -2224,7 +2224,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+ if (unreachable)
+ __vm_area_free(vma);
+@@ -2269,7 +2269,7 @@ int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *vma,
goto out_free_mpol;
if (new->vm_file)
if (new->vm_ops && new->vm_ops->open)
new->vm_ops->open(new);
-@@ -2246,7 +2246,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
- if (new->vm_ops && new->vm_ops->close)
- new->vm_ops->close(new);
- if (new->vm_file)
-- fput(new->vm_file);
-+ vma_fput(new);
- unlink_anon_vmas(new);
- out_free_mpol:
- mpol_put(vma_policy(new));
-@@ -2746,7 +2746,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
- if (vma->vm_ops && vma->vm_ops->close)
- vma->vm_ops->close(vma);
+@@ -2774,7 +2774,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+
+ if (file || vma->vm_file) {
unmap_and_free_vma:
-- fput(vma->vm_file);
-+ vma_fput(vma);
- vma->vm_file = NULL;
+- fput(vma->vm_file);
++ vma_fput(vma);
+ vma->vm_file = NULL;
- /* Undo any partial mapping done by a device driver. */
-@@ -2813,6 +2813,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+ /* Undo any partial mapping done by a device driver. */
+@@ -2843,6 +2843,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
unsigned long populate = 0;
unsigned long ret = -EINVAL;
struct file *file;
-+#if IS_ENABLED(CONFIG_AUFS_FS)
++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ struct file *prfile;
+#endif
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/mm/remap_file_pages.rst.\n",
current->comm, current->pid);
-@@ -2871,10 +2874,34 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -2901,10 +2904,34 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
if (vma->vm_flags & VM_LOCKED)
flags |= MAP_LOCKED;
-+#if IS_ENABLED(CONFIG_AUFS_FS)
++#if 1 /* IS_ENABLED(CONFIG_AUFS_FS) */
+ vma_get_file(vma);
+ file = vma->vm_file;
+ prfile = vma->vm_prfile;
out:
mmap_write_unlock(mm);
if (populate)
-@@ -3222,7 +3249,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -3250,7 +3277,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
if (anon_vma_clone(new_vma, vma))
goto out_free_mempol;
if (new_vma->vm_file)
+ vma_get_file(new_vma);
if (new_vma->vm_ops && new_vma->vm_ops->open)
new_vma->vm_ops->open(new_vma);
- if (vma_link(mm, new_vma))
+ vma_start_write(new_vma);
+@@ -3266,7 +3293,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+ new_vma->vm_ops->close(new_vma);
+
+ if (new_vma->vm_file)
+- fput(new_vma->vm_file);
++ vma_fput(new_vma);
+
+ unlink_anon_vmas(new_vma);
+ out_free_mempol:
diff --git a/mm/nommu.c b/mm/nommu.c
-index 214c70e1d059..dccbb939d2a9 100644
+index f670d9979a26..94d41bc45915 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -523,7 +523,7 @@ static void __put_nommu_region(struct vm_region *region)
/* IO memory and memory shared directly out of the pagecache
* from ramfs/tmpfs mustn't be released here */
-@@ -653,7 +653,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -602,7 +602,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
if (vma->vm_ops && vma->vm_ops->close)
vma->vm_ops->close(vma);
if (vma->vm_file)
put_nommu_region(vma->vm_region);
vm_area_free(vma);
}
-@@ -1164,7 +1164,7 @@ unsigned long do_mmap(struct file *file,
+@@ -1124,7 +1124,7 @@ unsigned long do_mmap(struct file *file,
goto error_just_free;
}
}
kmem_cache_free(vm_region_jar, region);
region = pregion;
result = start;
-@@ -1242,10 +1242,11 @@ error_just_free:
+@@ -1206,10 +1206,10 @@ unsigned long do_mmap(struct file *file,
error:
- mas_destroy(&mas);
+ vma_iter_free(&vmi);
if (region->vm_file)
- fput(region->vm_file);
-+ vmr_fput(region);
++ vmr_fput(region);
kmem_cache_free(vm_region_jar, region);
if (vma->vm_file)
- fput(vma->vm_file);
-+ vmr_fput(vma);
+- fput(vma->vm_file);
++ vma_fput(vma);
vm_area_free(vma);
return ret;
/**
* d_ancestor - search for an ancestor
diff --git a/fs/exec.c b/fs/exec.c
-index ab913243a367..d84461fddf7d 100644
+index a466e797c8e2..c60353b5214f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
-@@ -111,6 +111,7 @@ bool path_noexec(const struct path *path)
+@@ -112,6 +112,7 @@ bool path_noexec(const struct path *path)
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
}
#ifdef CONFIG_USELIB
/*
diff --git a/fs/fcntl.c b/fs/fcntl.c
-index c980a0524118..40087d11a974 100644
+index 9ea58b7bb580..99fef189bcd6 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
-@@ -86,6 +86,7 @@ int setfl(int fd, struct file *filp, unsigned long arg)
+@@ -87,6 +87,7 @@ int setfl(int fd, struct file *filp, unsigned long arg)
out:
return error;
}
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
int force)
diff --git a/fs/file_table.c b/fs/file_table.c
-index dd88701e54a9..ecdb7817b074 100644
+index 372653b92617..69128fe39b6d 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
-@@ -198,6 +198,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
+@@ -199,6 +199,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
}
return ERR_PTR(-ENFILE);
}
/*
* Variant of alloc_empty_file() that doesn't check and modify nr_files.
diff --git a/fs/namespace.c b/fs/namespace.c
-index 8cd34f760f63..799a94205906 100644
+index ebb7b4b057ea..6ee47677de2f 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -571,6 +571,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
+@@ -457,6 +457,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
mnt_dec_writers(real_mount(mnt));
preempt_enable();
}
/**
* mnt_drop_write - give up write access to a mount
-@@ -968,6 +969,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
+@@ -854,6 +855,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
{
return check_mnt(real_mount(mnt));
}
/*
* vfsmount lock must be held for write
-@@ -2165,6 +2167,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
+@@ -2062,6 +2064,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
/*
* Drop a reference to a group. Free it if it's through.
diff --git a/fs/open.c b/fs/open.c
-index 82c1a28b3308..e7bd6f1c9474 100644
+index 4478adcc4f3a..5a984ff90580 100644
--- a/fs/open.c
+++ b/fs/open.c
-@@ -66,6 +66,7 @@ int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry,
+@@ -67,6 +67,7 @@ int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry,
inode_unlock(dentry->d_inode);
return ret;
}
long vfs_truncate(const struct path *path, loff_t length)
{
diff --git a/fs/read_write.c b/fs/read_write.c
-index 7a2ff6157eda..76f5d4d08687 100644
+index a21ba3be7dbe..ec40061176b3 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -477,6 +477,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
/* file_ppos returns &file->f_pos or NULL if file is stream */
static inline loff_t *file_ppos(struct file *file)
diff --git a/fs/splice.c b/fs/splice.c
-index 21db9b057d60..abcd14f52c1e 100644
+index 97a66df75d4c..19c8d35f5ebd 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -763,6 +763,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -872,6 +872,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return warn_unsupported(out, "write");
return out->f_op->splice_write(pipe, out, ppos, len, flags);
}
/*
* Attempt to initiate a splice from a file to a pipe.
-@@ -792,6 +793,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
+@@ -901,6 +902,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return warn_unsupported(in, "read");
return in->f_op->splice_read(in, ppos, pipe, len, flags);
}
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/fs/xattr.c b/fs/xattr.c
-index adab9a70b536..b2dc4fc0b25b 100644
+index fcf67d80d7f9..174dfb9285fb 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
-@@ -407,6 +407,7 @@ vfs_getxattr_alloc(struct user_namespace *mnt_userns, struct dentry *dentry,
+@@ -406,6 +406,7 @@ vfs_getxattr_alloc(struct mnt_idmap *idmap, struct dentry *dentry,
*xattr_value = value;
return error;
}
ssize_t
__vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name,
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
-index c1f0aadde539..278e0a322d20 100644
+index 85d1f7e0bc07..5e20504eed24 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
-@@ -238,6 +238,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
+@@ -239,6 +239,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
*/
return lock_classes + class_idx;
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
diff --git a/security/security.c b/security/security.c
-index d1571900a8c7..c8333d54e590 100644
+index d5ff7ff45b77..5cca1f5774ef 100644
--- a/security/security.c
+++ b/security/security.c
-@@ -1195,6 +1195,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
+@@ -1711,6 +1711,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
return 0;
return call_int_hook(path_rmdir, 0, dir, dentry);
}
+EXPORT_SYMBOL_GPL(security_path_rmdir);
- int security_path_unlink(const struct path *dir, struct dentry *dentry)
- {
-@@ -1211,6 +1212,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
+ /**
+ * security_path_unlink() - Check if removing a hard link is allowed
+@@ -1746,6 +1747,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
return 0;
return call_int_hook(path_symlink, 0, dir, dentry, old_name);
}
+EXPORT_SYMBOL_GPL(security_path_symlink);
- int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
- struct dentry *new_dentry)
-@@ -1219,6 +1221,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
+ /**
+ * security_path_link - Check if creating a hard link is allowed
+@@ -1764,6 +1766,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
return 0;
return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
}
+EXPORT_SYMBOL_GPL(security_path_link);
- int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
- const struct path *new_dir, struct dentry *new_dentry,
-@@ -1239,6 +1242,7 @@ int security_path_truncate(const struct path *path)
- return 0;
- return call_int_hook(path_truncate, 0, path);
- }
-+EXPORT_SYMBOL_GPL(security_path_truncate);
-
- int security_path_chmod(const struct path *path, umode_t mode)
- {
-@@ -1246,6 +1250,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
+ /**
+ * security_path_rename() - Check if renaming a file is allowed
+@@ -1825,6 +1828,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
return 0;
return call_int_hook(path_chmod, 0, path, mode);
}
+EXPORT_SYMBOL_GPL(security_path_chmod);
- int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
- {
-@@ -1253,6 +1258,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
+ /**
+ * security_path_chown() - Check if changing the file's owner/group is allowed
+@@ -1842,6 +1846,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
return 0;
return call_int_hook(path_chown, 0, path, uid, gid);
}
+EXPORT_SYMBOL_GPL(security_path_chown);
- int security_path_chroot(const struct path *path)
- {
-@@ -1353,6 +1359,7 @@ int security_inode_permission(struct inode *inode, int mask)
+ /**
+ * security_path_chroot() - Check if changing the root directory is allowed
+@@ -2071,6 +2076,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
+EXPORT_SYMBOL_GPL(security_inode_permission);
- int security_inode_setattr(struct user_namespace *mnt_userns,
- struct dentry *dentry, struct iattr *attr)
-@@ -1593,6 +1600,7 @@ int security_file_permission(struct file *file, int mask)
+ /**
+ * security_inode_setattr() - Check if setting file attributes is allowed
+@@ -2549,6 +2555,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
+EXPORT_SYMBOL_GPL(security_file_permission);
- int security_file_alloc(struct file *file)
- {
-@@ -1726,6 +1734,7 @@ int security_file_truncate(struct file *file)
+ /**
+ * security_file_alloc() - Allocate and init a file's LSM blob
+@@ -2815,6 +2822,7 @@ int security_file_truncate(struct file *file)
{
return call_int_hook(file_truncate, 0, file);
}
+EXPORT_SYMBOL_GPL(security_file_truncate);
- int security_task_alloc(struct task_struct *task, unsigned long clone_flags)
- {
+ /**
+ * security_task_alloc() - Allocate a task's LSM blob
diff -urN /usr/share/empty/Documentation/ABI/testing/debugfs-aufs linux/Documentation/ABI/testing/debugfs-aufs
--- /usr/share/empty/Documentation/ABI/testing/debugfs-aufs 1970-01-01 01:00:00.000000000 +0100
+++ linux/Documentation/ABI/testing/debugfs-aufs 2022-11-05 23:02:18.955889283 +0100
+regular files only.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documentation/filesystems/aufs/README
--- /usr/share/empty/Documentation/filesystems/aufs/README 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/README 2023-02-20 21:05:51.959693785 +0100
++++ linux/Documentation/filesystems/aufs/README 2023-07-04 23:43:55.846316200 +0200
@@ -0,0 +1,408 @@
+
+Aufs6 -- advanced multi layered unification filesystem version 6.x
+James Burry made a donation (2016/12).
+Carsten Rose made a donation (2018/9).
+Porteus Kiosk made a donation (2018/10).
-+Enya Quetzalli Gomez Rodriguez made a donation (2022/5).
++huronOS team: Enya Quetzalli made donations (2022/5 and 2023/5).
+
+Thank you very much.
+Donations are always, including future donations, very important and
+}
diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
--- /usr/share/empty/fs/aufs/branch.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.h 2022-11-05 23:02:18.959222617 +0100
++++ linux/fs/aufs/branch.h 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,375 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ return br->br_path.dentry;
+}
+
-+static inline struct user_namespace *au_br_userns(struct au_branch *br)
++static inline struct mnt_idmap *au_br_idmap(struct au_branch *br)
+{
-+ return mnt_user_ns(br->br_path.mnt);
++ return mnt_idmap(br->br_path.mnt);
+}
+
+static inline struct super_block *au_br_sb(struct au_branch *br)
+}
+
+static inline
-+struct user_namespace *au_sbr_userns(struct super_block *sb, aufs_bindex_t bindex)
++struct mnt_idmap *au_sbr_idmap(struct super_block *sb, aufs_bindex_t bindex)
+{
-+ return au_br_userns(au_sbr(sb, bindex));
++ return au_br_idmap(au_sbr(sb, bindex));
+}
+
+static inline
+-include ${srctree}/${src}/conf_priv.mk
diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
--- /usr/share/empty/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.c 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/cpup.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,1459 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ int err;
+ struct dentry *h_dentry;
+ /* struct inode *h_inode; */
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
-+ h_userns = mnt_user_ns(h_path->mnt);
++ h_idmap = mnt_idmap(h_path->mnt);
+ h_dentry = h_path->dentry;
+ /* h_inode = d_inode(h_dentry); */
+ /* forget_all_cached_acls(h_inode)); */
-+ err = vfsub_remove_acl(h_userns, h_dentry, XATTR_NAME_POSIX_ACL_ACCESS);
++ err = vfsub_remove_acl(h_idmap, h_dentry, XATTR_NAME_POSIX_ACL_ACCESS);
+ AuTraceErr(err);
+ if (err == -EOPNOTSUPP)
+ err = 0;
+ if (!err)
-+ err = vfsub_acl_chmod(h_userns, h_dentry, mode);
++ err = vfsub_acl_chmod(h_idmap, h_dentry, mode);
+
+ AuTraceErr(err);
+ return err;
+{
+ int err;
+ struct inode *dir, *inode;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
-+ h_userns = mnt_user_ns(h_path->mnt);
-+ err = vfsub_remove_acl(h_userns, h_path->dentry,
++ h_idmap = mnt_idmap(h_path->mnt);
++ err = vfsub_remove_acl(h_idmap, h_path->dentry,
+ XATTR_NAME_POSIX_ACL_DEFAULT);
+ AuTraceErr(err);
+ if (err == -EOPNOTSUPP)
+ struct dentry *dentry, *parent;
+ struct file *h_file;
+ struct inode *h_dir;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ dentry = cpg->dentry;
+ h_file = NULL;
+
+ parent = dget_parent(dentry);
+ h_dir = au_h_iptr(d_inode(parent), cpg->bdst);
-+ h_userns = au_sbr_userns(dentry->d_sb, cpg->bdst);
-+ if (!au_test_h_perm_sio(h_userns, h_dir, MAY_EXEC | MAY_WRITE)
++ h_idmap = au_sbr_idmap(dentry->d_sb, cpg->bdst);
++ if (!au_test_h_perm_sio(h_idmap, h_dir, MAY_EXEC | MAY_WRITE)
+ && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode))
+ err = au_cpup_simple(cpg);
+ else {
+ struct inode *dir, *h_dir, *h_tmpdir;
+ struct au_wbr *wbr;
+ struct au_pin wh_pin, *pin_orig;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ dentry = cpg->dentry;
+ bdst = cpg->bdst;
+ cpg->pin = &wh_pin;
+ }
+
-+ h_userns = au_sbr_userns(dentry->d_sb, bdst);
-+ if (!au_test_h_perm_sio(h_userns, h_tmpdir, MAY_EXEC | MAY_WRITE)
++ h_idmap = au_sbr_idmap(dentry->d_sb, bdst);
++ if (!au_test_h_perm_sio(h_idmap, h_tmpdir, MAY_EXEC | MAY_WRITE)
+ && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode))
+ err = au_cpup_wh(cpg, file);
+ else {
+#endif /* __AUFS_DEBUG_H__ */
diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
--- /usr/share/empty/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.c 2022-11-05 23:02:18.962555950 +0100
++++ linux/fs/aufs/dentry.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,1168 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ struct dentry *h_dentry;
+ struct inode *h_inode;
+ struct au_branch *br;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+ struct path h_path;
+ int wh_found, opq;
+ unsigned char wh_able;
+ br = au_sbr(dentry->d_sb, bindex);
+ h_path.dentry = h_parent;
+ h_path.mnt = au_br_mnt(br);
-+ h_userns = au_br_userns(br);
++ h_idmap = au_br_idmap(br);
+ wh_able = !!au_br_whable(br->br_perm);
+ if (wh_able)
-+ wh_found = au_wh_test(h_userns, &h_path, &args->whname,
++ wh_found = au_wh_test(h_idmap, &h_path, &args->whname,
+ ignore_perm);
+ h_dentry = ERR_PTR(wh_found);
+ if (!wh_found)
+ if (!ignore_perm)
+ h_dentry = vfsub_lkup_one(args->name, &h_path);
+ else
-+ h_dentry = au_sio_lkup_one(h_userns, args->name, &h_path);
++ h_dentry = au_sio_lkup_one(h_idmap, args->name, &h_path);
+ if (IS_ERR(h_dentry)) {
+ if (PTR_ERR(h_dentry) == -ENAMETOOLONG
+ && !allow_neg)
+
+ h_path.dentry = h_dentry;
+ inode_lock_shared_nested(h_inode, AuLsc_I_CHILD);
-+ opq = au_diropq_test(h_userns, &h_path);
++ opq = au_diropq_test(h_idmap, &h_path);
+ inode_unlock_shared(h_inode);
+ if (opq > 0)
+ au_set_dbdiropq(dentry, bindex);
+ return err;
+}
+
-+struct dentry *au_sio_lkup_one(struct user_namespace *userns, struct qstr *name,
++struct dentry *au_sio_lkup_one(struct mnt_idmap *idmap, struct qstr *name,
+ struct path *ppath)
+{
+ struct dentry *dentry;
+ int wkq_err;
+
-+ if (!au_test_h_perm_sio(userns, d_inode(ppath->dentry), MAY_EXEC))
++ if (!au_test_h_perm_sio(idmap, d_inode(ppath->dentry), MAY_EXEC))
+ dentry = vfsub_lkup_one(name, ppath);
+ else {
+ struct vfsub_lkup_one_args args = {
+ int err;
+ struct dentry *parent, *h_dentry;
+ struct au_branch *br;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+ struct path h_ppath;
+
+ parent = dget_parent(dentry);
+ br = au_sbr(dentry->d_sb, bindex);
+ h_ppath.dentry = au_h_dptr(parent, bindex);
+ h_ppath.mnt = au_br_mnt(br);
-+ h_userns = au_br_userns(br);
++ h_idmap = au_br_idmap(br);
+ if (wh)
+ h_dentry = au_whtmp_lkup(h_ppath.dentry, br, &dentry->d_name);
+ else
-+ h_dentry = au_sio_lkup_one(h_userns, &dentry->d_name, &h_ppath);
++ h_dentry = au_sio_lkup_one(h_idmap, &dentry->d_name, &h_ppath);
+ err = PTR_ERR(h_dentry);
+ if (IS_ERR(h_dentry))
+ goto out;
+};
diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
--- /usr/share/empty/fs/aufs/dentry.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.h 2022-12-17 09:21:34.796521861 +0100
++++ linux/fs/aufs/dentry.h 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,270 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+/* dentry.c */
+extern const struct dentry_operations aufs_dop, aufs_dop_noreval;
+struct au_branch;
-+struct dentry *au_sio_lkup_one(struct user_namespace *userns, struct qstr *name,
++struct dentry *au_sio_lkup_one(struct mnt_idmap *idmap, struct qstr *name,
+ struct path *ppath);
+int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir,
+ struct dentry *h_parent, struct au_branch *br);
+}
diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
--- /usr/share/empty/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.c 2022-12-17 09:21:34.796521861 +0100
++++ linux/fs/aufs/dir.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,765 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ int err, wkq_err;
+ struct dentry *h_dentry;
+ struct inode *h_inode;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
-+ h_userns = au_sbr_userns(dentry->d_sb, arg->bindex);
++ h_idmap = au_sbr_idmap(dentry->d_sb, arg->bindex);
+ h_dentry = au_h_dptr(dentry, arg->bindex);
+ h_inode = d_inode(h_dentry);
+ /* todo: i_mode changes anytime? */
+ inode_lock_shared_nested(h_inode, AuLsc_I_CHILD);
-+ err = au_test_h_perm_sio(h_userns, h_inode, MAY_EXEC | MAY_READ);
++ err = au_test_h_perm_sio(h_idmap, h_inode, MAY_EXEC | MAY_READ);
+ inode_unlock_shared(h_inode);
+ if (!err)
+ err = do_test_empty(dentry, arg);
+}
diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
--- /usr/share/empty/fs/aufs/inode.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.c 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/inode.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,531 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ return err;
+}
+
-+int au_test_h_perm(struct user_namespace *h_userns, struct inode *h_inode,
++int au_test_h_perm(struct mnt_idmap *h_idmap, struct inode *h_inode,
+ int mask)
+{
+ if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID))
+ return 0;
-+ return inode_permission(h_userns, h_inode, mask);
++ return inode_permission(h_idmap, h_inode, mask);
+}
+
-+int au_test_h_perm_sio(struct user_namespace *h_userns, struct inode *h_inode,
++int au_test_h_perm_sio(struct mnt_idmap *h_idmap, struct inode *h_inode,
+ int mask)
+{
+ if (au_test_nfs(h_inode->i_sb)
+ && (mask & MAY_WRITE)
+ && S_ISDIR(h_inode->i_mode))
+ mask |= MAY_READ; /* force permission check */
-+ return au_test_h_perm(h_userns, h_inode, mask);
++ return au_test_h_perm(h_idmap, h_inode, mask);
+}
diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
--- /usr/share/empty/fs/aufs/inode.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.h 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/inode.h 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,707 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+struct inode *au_new_inode(struct dentry *dentry, int must_new);
+int au_test_ro(struct super_block *sb, aufs_bindex_t bindex,
+ struct inode *inode);
-+int au_test_h_perm(struct user_namespace *h_userns, struct inode *h_inode,
++int au_test_h_perm(struct mnt_idmap *h_idmap, struct inode *h_inode,
+ int mask);
-+int au_test_h_perm_sio(struct user_namespace *h_userns, struct inode *h_inode,
++int au_test_h_perm_sio(struct mnt_idmap *h_idmap, struct inode *h_inode,
+ int mask);
+
+static inline int au_wh_ino(struct super_block *sb, aufs_bindex_t bindex,
+/* i_op_add.c */
+int au_may_add(struct dentry *dentry, aufs_bindex_t bindex,
+ struct dentry *h_parent, int isdir);
-+int aufs_mknod(struct user_namespace *userns, struct inode *dir,
++int aufs_mknod(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, umode_t mode, dev_t dev);
-+int aufs_symlink(struct user_namespace *userns, struct inode *dir,
++int aufs_symlink(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, const char *symname);
-+int aufs_create(struct user_namespace *userns, struct inode *dir,
++int aufs_create(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, umode_t mode, bool want_excl);
+struct vfsub_aopen_args;
+int au_aopen_or_create(struct inode *dir, struct dentry *dentry,
+ struct vfsub_aopen_args *args);
-+int aufs_tmpfile(struct user_namespace *userns, struct inode *dir,
++int aufs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
+ struct file *file, umode_t mode);
+int aufs_link(struct dentry *src_dentry, struct inode *dir,
+ struct dentry *dentry);
-+int aufs_mkdir(struct user_namespace *userns, struct inode *dir,
++int aufs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, umode_t mode);
+
+/* i_op_del.c */
+
+/* i_op_ren.c */
+int au_wbr(struct dentry *dentry, aufs_bindex_t btgt);
-+int aufs_rename(struct user_namespace *userns,
++int aufs_rename(struct mnt_idmap *idmap,
+ struct inode *_src_dir, struct dentry *_src_dentry,
+ struct inode *_dst_dir, struct dentry *_dst_dentry,
+ unsigned int _flags);
+
+#ifdef CONFIG_FS_POSIX_ACL
+struct posix_acl *aufs_get_inode_acl(struct inode *inode, int type, bool rcu);
-+struct posix_acl *aufs_get_acl(struct user_namespace *userns,
++struct posix_acl *aufs_get_acl(struct mnt_idmap *idmap,
+ struct dentry *dentry, int type);
-+int aufs_set_acl(struct user_namespace *userns, struct dentry *dentry,
++int aufs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
+ struct posix_acl *acl, int type);
+#endif
+
+#endif
diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
--- /usr/share/empty/fs/aufs/i_op_add.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_add.c 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/i_op_add.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,972 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ return err;
+}
+
-+int aufs_mknod(struct user_namespace *userns, struct inode *dir,
++int aufs_mknod(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, umode_t mode, dev_t dev)
+{
+ struct simple_arg arg = {
+ return add_simple(dir, dentry, &arg);
+}
+
-+int aufs_symlink(struct user_namespace *userns, struct inode *dir,
++int aufs_symlink(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, const char *symname)
+{
+ struct simple_arg arg = {
+ return add_simple(dir, dentry, &arg);
+}
+
-+int aufs_create(struct user_namespace *userns, struct inode *dir,
++int aufs_create(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, umode_t mode, bool want_excl)
+{
+ struct simple_arg arg = {
+ return add_simple(dir, dentry, &arg);
+}
+
-+int aufs_tmpfile(struct user_namespace *userns, struct inode *dir,
++int aufs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
+ struct file *file, umode_t mode)
+{
+ int err;
+ struct dentry *dentry, *parent, *h_parent, *h_dentry;
+ struct inode *h_dir, *inode;
+ struct vfsmount *h_mnt;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+ struct file *h_file;
+ struct au_wr_dir_args wr_dir_args = {
+ .force_btgt = -1,
+ if (unlikely(err))
+ goto out_parent;
+
-+ h_userns = mnt_user_ns(h_mnt);
++ h_idmap = mnt_idmap(h_mnt);
+ h_parent = au_h_dptr(parent, bindex);
+ h_ppath.mnt = h_mnt;
+ h_ppath.dentry = h_parent;
-+ h_file = vfs_tmpfile_open(h_userns, &h_ppath, mode, /*open_flag*/0,
++ h_file = vfs_tmpfile_open(h_idmap, &h_ppath, mode, /*open_flag*/0,
+ current_cred());
+ if (IS_ERR(h_file)) {
+ err = PTR_ERR(h_file);
+ return err;
+}
+
-+int aufs_mkdir(struct user_namespace *userns, struct inode *dir,
++int aufs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
+ struct dentry *dentry, umode_t mode)
+{
+ int err, rerr;
+}
diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
--- /usr/share/empty/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op.c 2023-02-20 21:05:51.959693785 +0100
-@@ -0,0 +1,1516 @@
++++ linux/fs/aufs/i_op.c 2023-04-24 08:13:40.969576115 +0200
+@@ -0,0 +1,1517 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2005-2022 Junjiro R. Okajima
+ */
+
+#include <linux/device_cgroup.h>
++#include <linux/filelock.h>
+#include <linux/fs_stack.h>
+#include <linux/iversion.h>
+#include <linux/security.h>
+{
+ int err;
+ const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND));
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ err = -EPERM;
+ if (write_mask && IS_IMMUTABLE(h_inode))
+ * - nfs always sets SB_POSIXACL regardless its mount option 'noacl.'
+ * in this case, generic_permission() returns -EOPNOTSUPP.
+ */
-+ h_userns = mnt_user_ns(h_path->mnt);
++ h_idmap = mnt_idmap(h_path->mnt);
+ if ((write_mask && !au_br_writable(brperm))
+ || (au_test_nfs(h_inode->i_sb) && S_ISDIR(h_inode->i_mode)
+ && write_mask && !(mask & MAY_READ))
+ /* AuLabel(generic_permission); */
+ /* AuDbg("get_inode_acl %ps\n",
+ h_inode->i_op->get_inode_acl); */
-+ err = generic_permission(h_userns, h_inode, mask);
++ err = generic_permission(h_idmap, h_inode, mask);
+ if (err == -EOPNOTSUPP && au_test_nfs_noacl(h_inode))
-+ err = h_inode->i_op->permission(h_userns, h_inode,
++ err = h_inode->i_op->permission(h_idmap, h_inode,
+ mask);
+ AuTraceErr(err);
+ } else {
+ /* AuLabel(h_inode->permission); */
-+ err = h_inode->i_op->permission(h_userns, h_inode, mask);
++ err = h_inode->i_op->permission(h_idmap, h_inode, mask);
+ AuTraceErr(err);
+ }
+
+ return err;
+}
+
-+static int aufs_permission(struct user_namespace *userns, struct inode *inode,
++static int aufs_permission(struct mnt_idmap *idmap, struct inode *inode,
+ int mask)
+{
+ int err;
+ return err;
+}
+
-+static int aufs_setattr(struct user_namespace *userns, struct dentry *dentry,
++static int aufs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
+ struct iattr *ia)
+{
+ int err;
+ struct super_block *sb;
+ struct file *file;
+ struct au_icpup_args *a;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ inode = d_inode(dentry);
+ IMustLock(inode);
+
-+ err = setattr_prepare(userns, dentry, ia);
++ err = setattr_prepare(idmap, dentry, ia);
+ if (unlikely(err))
+ goto out;
+
+ * why don't all acl-aware fs call this func from their ->setattr()?
+ */
+ if (!err && (ia->ia_valid & ATTR_MODE)) {
-+ h_userns = mnt_user_ns(a->h_path.mnt);
-+ err = vfsub_acl_chmod(h_userns, a->h_path.dentry, ia->ia_mode);
++ h_idmap = mnt_idmap(a->h_path.mnt);
++ err = vfsub_acl_chmod(h_idmap, a->h_path.dentry, ia->ia_mode);
+ }
+ if (!err)
+ au_cpup_attr_changeable(inode);
+ struct super_block *sb;
+ struct au_icpup_args *a;
+ struct inode *h_inode;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ IMustLock(inode);
+
+ err = au_h_path_to_set_attr(dentry, a, &h_path);
+ if (unlikely(err))
+ goto out_di;
-+ h_userns = mnt_user_ns(h_path.mnt);
++ h_idmap = mnt_idmap(h_path.mnt);
+
+ inode_unlock(a->h_inode);
+ switch (arg->type) {
+ case AU_XATTR_SET:
+ AuDebugOn(d_is_negative(h_path.dentry));
-+ err = vfsub_setxattr(h_userns, h_path.dentry,
++ err = vfsub_setxattr(h_idmap, h_path.dentry,
+ arg->u.set.name, arg->u.set.value,
+ arg->u.set.size, arg->u.set.flags);
+ break;
+ h_inode = d_inode(h_path.dentry);
+ if (h_inode->i_op->set_acl) {
+ /* this will call posix_acl_update_mode */
-+ err = h_inode->i_op->set_acl(h_userns, h_path.dentry,
++ err = h_inode->i_op->set_acl(h_idmap, h_path.dentry,
+ arg->u.acl_set.acl,
+ arg->u.acl_set.type);
+ }
+ return err;
+}
+
-+static int aufs_getattr(struct user_namespace *userns, const struct path *path,
++static int aufs_getattr(struct mnt_idmap *idmap, const struct path *path,
+ struct kstat *st, u32 request, unsigned int query)
+{
+ int err;
+ goto out_di;
+
+out_fill:
-+ generic_fillattr(userns, inode, st);
++ generic_fillattr(idmap, inode, st);
+out_di:
+ di_read_unlock(dentry, AuLock_IR);
+out_si:
+};
diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
--- /usr/share/empty/fs/aufs/i_op_del.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_del.c 2022-11-05 23:02:18.965889284 +0100
++++ linux/fs/aufs/i_op_del.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,522 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ struct path h_ppath;
+ struct super_block *sb;
+ struct au_branch *br;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ h_dentry = au_h_dptr(dentry, bindex);
+ if (d_really_is_positive(dentry)) {
+ err = -EACCES;
+ sb = dentry->d_sb;
+ br = au_sbr(sb, bindex);
-+ h_userns = au_br_userns(br);
++ h_idmap = au_br_idmap(br);
+ if (unlikely(!au_opt_test(au_mntflags(sb), DIRPERM1)
-+ && au_test_h_perm(h_userns, d_inode(h_parent),
++ && au_test_h_perm(h_idmap, d_inode(h_parent),
+ MAY_EXEC | MAY_WRITE)))
+ goto out;
+
+ h_ppath.dentry = h_parent;
+ h_ppath.mnt = au_br_mnt(br);
-+ h_latest = au_sio_lkup_one(h_userns, &dentry->d_name, &h_ppath);
++ h_latest = au_sio_lkup_one(h_idmap, &dentry->d_name, &h_ppath);
+ err = -EIO;
+ if (IS_ERR(h_latest))
+ goto out;
+}
diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
--- /usr/share/empty/fs/aufs/i_op_ren.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_ren.c 2022-11-05 23:02:18.965889284 +0100
++++ linux/fs/aufs/i_op_ren.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,1257 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+
+/* ---------------------------------------------------------------------- */
+
-+int aufs_rename(struct user_namespace *userns,
++int aufs_rename(struct mnt_idmap *idmap,
+ struct inode *_src_dir, struct dentry *_src_dentry,
+ struct inode *_dst_dir, struct dentry *_dst_dentry,
+ unsigned int _flags)
+}
diff -urN /usr/share/empty/fs/aufs/posix_acl.c linux/fs/aufs/posix_acl.c
--- /usr/share/empty/fs/aufs/posix_acl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/posix_acl.c 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/posix_acl.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ return acl;
+}
+
-+struct posix_acl *aufs_get_acl(struct user_namespace *userns,
++struct posix_acl *aufs_get_acl(struct mnt_idmap *idmap,
+ struct dentry *dentry, int type)
+{
+ struct posix_acl *acl;
+ return acl;
+}
+
-+int aufs_set_acl(struct user_namespace *userns, struct dentry *dentry,
++int aufs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
+ struct posix_acl *acl, int type)
+{
+ int err;
+}
diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
--- /usr/share/empty/fs/aufs/vfsub.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vfsub.c 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/vfsub.c 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,918 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+{
+ int err;
+ struct dentry *d;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ IMustLock(dir);
+
+ path->dentry = d;
+ if (unlikely(err))
+ goto out;
-+ userns = mnt_user_ns(path->mnt);
++ idmap = mnt_idmap(path->mnt);
+
+ lockdep_off();
-+ err = vfs_create(userns, dir, path->dentry, mode, want_excl);
++ err = vfs_create(idmap, dir, path->dentry, mode, want_excl);
+ lockdep_on();
+ if (!err) {
+ struct path tmp = *path;
+{
+ int err;
+ struct dentry *d;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ IMustLock(dir);
+
+ path->dentry = d;
+ if (unlikely(err))
+ goto out;
-+ userns = mnt_user_ns(path->mnt);
++ idmap = mnt_idmap(path->mnt);
+
+ lockdep_off();
-+ err = vfs_symlink(userns, dir, path->dentry, symname);
++ err = vfs_symlink(idmap, dir, path->dentry, symname);
+ lockdep_on();
+ if (!err) {
+ struct path tmp = *path;
+{
+ int err;
+ struct dentry *d;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ IMustLock(dir);
+
+ path->dentry = d;
+ if (unlikely(err))
+ goto out;
-+ userns = mnt_user_ns(path->mnt);
++ idmap = mnt_idmap(path->mnt);
+
+ lockdep_off();
-+ err = vfs_mknod(userns, dir, path->dentry, mode, dev);
++ err = vfs_mknod(idmap, dir, path->dentry, mode, dev);
+ lockdep_on();
+ if (!err) {
+ struct path tmp = *path;
+{
+ int err;
+ struct dentry *d;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ IMustLock(dir);
+
+ path->dentry = d;
+ if (unlikely(err))
+ goto out;
-+ userns = mnt_user_ns(path->mnt);
++ idmap = mnt_idmap(path->mnt);
+
+ lockdep_off();
-+ err = vfs_link(src_dentry, userns, dir, path->dentry, delegated_inode);
++ err = vfs_link(src_dentry, idmap, dir, path->dentry, delegated_inode);
+ lockdep_on();
+ if (!err) {
+ struct path tmp = *path;
+ if (unlikely(err))
+ goto out;
+
-+ rd.old_mnt_userns = mnt_user_ns(path->mnt);
++ rd.old_mnt_idmap = mnt_idmap(path->mnt);
+ rd.old_dir = src_dir;
+ rd.old_dentry = src_dentry;
-+ rd.new_mnt_userns = rd.old_mnt_userns;
++ rd.new_mnt_idmap = rd.old_mnt_idmap;
+ rd.new_dir = dir;
+ rd.new_dentry = path->dentry;
+ rd.delegated_inode = delegated_inode;
+{
+ int err;
+ struct dentry *d;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ IMustLock(dir);
+
+ path->dentry = d;
+ if (unlikely(err))
+ goto out;
-+ userns = mnt_user_ns(path->mnt);
++ idmap = mnt_idmap(path->mnt);
+
+ lockdep_off();
-+ err = vfs_mkdir(userns, dir, path->dentry, mode);
++ err = vfs_mkdir(idmap, dir, path->dentry, mode);
+ lockdep_on();
+ if (!err) {
+ struct path tmp = *path;
+{
+ int err;
+ struct dentry *d;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ IMustLock(dir);
+
+ path->dentry = d;
+ if (unlikely(err))
+ goto out;
-+ userns = mnt_user_ns(path->mnt);
++ idmap = mnt_idmap(path->mnt);
+
+ lockdep_off();
-+ err = vfs_rmdir(userns, dir, path->dentry);
++ err = vfs_rmdir(idmap, dir, path->dentry);
+ lockdep_on();
+ if (!err) {
+ struct path tmp = {
+ int err;
+ struct inode *h_inode;
+ struct super_block *h_sb;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ if (!h_file) {
+ err = vfsub_truncate(h_path, length);
+ lockdep_on();
+ err = security_file_truncate(h_file);
+ if (!err) {
-+ h_userns = mnt_user_ns(h_path->mnt);
++ h_idmap = mnt_idmap(h_path->mnt);
+ lockdep_off();
-+ err = do_truncate(h_userns, h_path->dentry, length, attr,
++ err = do_truncate(h_idmap, h_path->dentry, length, attr,
+ h_file);
+ lockdep_on();
+ }
+int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode)
+{
+ int err, do_sio, wkq_err;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
-+ userns = mnt_user_ns(path->mnt);
-+ do_sio = au_test_h_perm_sio(userns, dir, MAY_EXEC | MAY_WRITE);
++ idmap = mnt_idmap(path->mnt);
++ do_sio = au_test_h_perm_sio(idmap, dir, MAY_EXEC | MAY_WRITE);
+ if (!do_sio) {
+ lockdep_off();
+ err = vfsub_mkdir(dir, path, mode);
+int vfsub_sio_rmdir(struct inode *dir, struct path *path)
+{
+ int err, do_sio, wkq_err;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
-+ userns = mnt_user_ns(path->mnt);
-+ do_sio = au_test_h_perm_sio(userns, dir, MAY_EXEC | MAY_WRITE);
++ idmap = mnt_idmap(path->mnt);
++ do_sio = au_test_h_perm_sio(idmap, dir, MAY_EXEC | MAY_WRITE);
+ if (!do_sio) {
+ lockdep_off();
+ err = vfsub_rmdir(dir, path);
+{
+ struct notify_change_args *a = args;
+ struct inode *h_inode;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+
+ h_inode = d_inode(a->path->dentry);
+ IMustLock(h_inode);
+
+ *a->errp = -EPERM;
+ if (!IS_IMMUTABLE(h_inode) && !IS_APPEND(h_inode)) {
-+ userns = mnt_user_ns(a->path->mnt);
++ idmap = mnt_idmap(a->path->mnt);
+ lockdep_off();
-+ *a->errp = notify_change(userns, a->path->dentry, a->ia,
++ *a->errp = notify_change(idmap, a->path->dentry, a->ia,
+ a->delegated_inode);
+ lockdep_on();
+ if (!*a->errp)
+ struct unlink_args *a = args;
+ struct dentry *d = a->path->dentry;
+ struct inode *h_inode;
-+ struct user_namespace *userns;
++ struct mnt_idmap *idmap;
+ const int stop_sillyrename = (au_test_nfs(d->d_sb)
+ && au_dcount(d) == 1);
+
+ ihold(h_inode);
+ }
+
-+ userns = mnt_user_ns(a->path->mnt);
++ idmap = mnt_idmap(a->path->mnt);
+ lockdep_off();
-+ *a->errp = vfs_unlink(userns, a->dir, d, a->delegated_inode);
++ *a->errp = vfs_unlink(idmap, a->dir, d, a->delegated_inode);
+ lockdep_on();
+ if (!*a->errp) {
+ struct path tmp = {
+}
diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
--- /usr/share/empty/fs/aufs/vfsub.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vfsub.h 2023-02-20 21:05:51.959693785 +0100
++++ linux/fs/aufs/vfsub.h 2023-04-24 08:13:40.969576115 +0200
@@ -0,0 +1,390 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+}
+
+#ifdef CONFIG_FS_POSIX_ACL
-+static inline int vfsub_acl_chmod(struct user_namespace *h_userns,
++static inline int vfsub_acl_chmod(struct mnt_idmap *h_idmap,
+ struct dentry *h_dentry, umode_t h_mode)
+{
+ int err;
+
-+ err = posix_acl_chmod(h_userns, h_dentry, h_mode);
++ err = posix_acl_chmod(h_idmap, h_dentry, h_mode);
+ if (err == -EOPNOTSUPP)
+ err = 0;
+ return err;
+}
+#else
-+AuStubInt0(vfsub_acl_chmod, struct user_namespace *h_userns,
++AuStubInt0(vfsub_acl_chmod, struct mnt_idmap *h_idmap,
+ struct dentry *h_dentry, umode_t h_mode);
+#endif
+
+
+/* ---------------------------------------------------------------------- */
+
-+static inline int vfsub_setxattr(struct user_namespace *userns,
++static inline int vfsub_setxattr(struct mnt_idmap *idmap,
+ struct dentry *dentry, const char *name,
+ const void *value, size_t size, int flags)
+{
+ int err;
+
+ lockdep_off();
-+ err = vfs_setxattr(userns, dentry, name, value, size, flags);
++ err = vfs_setxattr(idmap, dentry, name, value, size, flags);
+ lockdep_on();
+
+ return err;
+}
+
-+static inline int vfsub_removexattr(struct user_namespace *userns,
++static inline int vfsub_removexattr(struct mnt_idmap *idmap,
+ struct dentry *dentry, const char *name)
+{
+ int err;
+
+ lockdep_off();
-+ err = vfs_removexattr(userns, dentry, name);
++ err = vfs_removexattr(idmap, dentry, name);
+ lockdep_on();
+
+ return err;
+}
+
+#ifdef CONFIG_FS_POSIX_ACL
-+static inline int vfsub_set_acl(struct user_namespace *userns,
++static inline int vfsub_set_acl(struct mnt_idmap *idmap,
+ struct dentry *dentry, const char *name,
+ struct posix_acl *acl)
+{
+ int err;
+
+ lockdep_off();
-+ err = vfs_set_acl(userns, dentry, name, acl);
++ err = vfs_set_acl(idmap, dentry, name, acl);
+ lockdep_on();
+
+ return err;
+}
+
-+static inline int vfsub_remove_acl(struct user_namespace *userns,
++static inline int vfsub_remove_acl(struct mnt_idmap *idmap,
+ struct dentry *dentry, const char *name)
+{
+ int err;
+
+ lockdep_off();
-+ err = vfs_remove_acl(userns, dentry, name);
++ err = vfs_remove_acl(idmap, dentry, name);
+ lockdep_on();
+
+ return err;
+}
+#else
-+AuStubInt0(vfsub_set_acl, struct user_namespace *userns, struct dentry *dentry,
++AuStubInt0(vfsub_set_acl, struct mnt_idmap *idmap, struct dentry *dentry,
+ const char *name, struct posix_acl *acl);
-+AuStubInt0(vfsub_remove_acl, struct user_namespace *userns,
++AuStubInt0(vfsub_remove_acl, struct mnt_idmap *idmap,
+ struct dentry *dentry, const char *name);
+#endif
+
+};
diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
--- /usr/share/empty/fs/aufs/whout.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.c 2022-11-05 23:02:18.972555950 +0100
++++ linux/fs/aufs/whout.c 2023-04-24 08:13:40.972909448 +0200
@@ -0,0 +1,1072 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * test if the @wh_name exists under @h_ppath.
+ * @try_sio specifies the necessary of super-io.
+ */
-+int au_wh_test(struct user_namespace *h_userns, struct path *h_ppath,
++int au_wh_test(struct mnt_idmap *h_idmap, struct path *h_ppath,
+ struct qstr *wh_name, int try_sio)
+{
+ int err;
+ if (!try_sio)
+ wh_dentry = vfsub_lkup_one(wh_name, h_ppath);
+ else
-+ wh_dentry = au_sio_lkup_one(h_userns, wh_name, h_ppath);
++ wh_dentry = au_sio_lkup_one(h_idmap, wh_name, h_ppath);
+ err = PTR_ERR(wh_dentry);
+ if (IS_ERR(wh_dentry)) {
+ if (err == -ENAMETOOLONG)
+/*
+ * test if the @h_path->dentry sets opaque or not.
+ */
-+int au_diropq_test(struct user_namespace *h_userns, struct path *h_path)
++int au_diropq_test(struct mnt_idmap *h_idmap, struct path *h_path)
+{
+ int err;
+ struct inode *h_dir;
+
+ h_dir = d_inode(h_path->dentry);
-+ err = au_wh_test(h_userns, h_path, &diropq_name,
-+ au_test_h_perm_sio(h_userns, h_dir, MAY_EXEC));
++ err = au_wh_test(h_idmap, h_path, &diropq_name,
++ au_test_h_perm_sio(h_idmap, h_dir, MAY_EXEC));
+ return err;
+}
+
+ static unsigned short cnt;
+ struct qstr qs;
+ struct path h_ppath;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN);
+
+
+ h_ppath.dentry = h_parent;
+ h_ppath.mnt = au_br_mnt(br);
-+ h_userns = au_br_userns(br);
++ h_idmap = au_br_idmap(br);
+ qs.name = name;
+ for (i = 0; i < 3; i++) {
+ sprintf(p, "%.*x", AUFS_WH_TMP_LEN, cnt++);
-+ dentry = au_sio_lkup_one(h_userns, &qs, &h_ppath);
++ dentry = au_sio_lkup_one(h_idmap, &qs, &h_ppath);
+ if (IS_ERR(dentry) || d_is_negative(dentry))
+ goto out_name;
+ dput(dentry);
+ unsigned int flags)
+{
+ struct dentry *diropq, *h_dentry;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
-+ h_userns = au_sbr_userns(dentry->d_sb, bindex);
++ h_idmap = au_sbr_idmap(dentry->d_sb, bindex);
+ h_dentry = au_h_dptr(dentry, bindex);
-+ if (!au_test_h_perm_sio(h_userns, d_inode(h_dentry),
++ if (!au_test_h_perm_sio(h_idmap, d_inode(h_dentry),
+ MAY_EXEC | MAY_WRITE))
+ diropq = do_diropq(dentry, bindex, flags);
+ else {
+ struct path wh_path;
+ struct inode *wh_inode, *h_dir;
+ struct au_branch *br;
-+ struct user_namespace *h_userns;
++ struct mnt_idmap *h_idmap;
+
+ h_dir = d_inode(wh_dentry->d_parent); /* dir inode is locked */
+ IMustLock(h_dir);
+ br = au_sbr(dir->i_sb, bindex);
+ wh_path.dentry = wh_dentry;
+ wh_path.mnt = au_br_mnt(br);
-+ h_userns = au_br_userns(br);
++ h_idmap = au_br_idmap(br);
+ wh_inode = d_inode(wh_dentry);
+ inode_lock_nested(wh_inode, AuLsc_I_CHILD);
+
+ * someone else might change some whiteouts while we were sleeping.
+ * it means this whlist may have an obsoleted entry.
+ */
-+ if (!au_test_h_perm_sio(h_userns, wh_inode, MAY_EXEC | MAY_WRITE))
++ if (!au_test_h_perm_sio(h_idmap, wh_inode, MAY_EXEC | MAY_WRITE))
+ err = del_wh_children(&wh_path, whlist, bindex);
+ else {
+ int wkq_err;
+}
diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
--- /usr/share/empty/fs/aufs/whout.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.h 2022-11-05 23:02:18.972555950 +0100
++++ linux/fs/aufs/whout.h 2023-04-24 08:13:40.972909448 +0200
@@ -0,0 +1,87 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+
+/* whout.c */
+int au_wh_name_alloc(struct qstr *wh, const struct qstr *name);
-+int au_wh_test(struct user_namespace *h_userns, struct path *h_ppath,
++int au_wh_test(struct mnt_idmap *h_idmap, struct path *h_ppath,
+ struct qstr *wh_name, int try_sio);
-+int au_diropq_test(struct user_namespace *h_userns, struct path *h_path);
++int au_diropq_test(struct mnt_idmap *h_idmap, struct path *h_path);
+struct au_branch;
+struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br,
+ struct qstr *prefix);
+#endif /* __AUFS_WKQ_H__ */
diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
--- /usr/share/empty/fs/aufs/xattr.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xattr.c 2023-02-20 21:05:51.959693785 +0100
-@@ -0,0 +1,365 @@
++++ linux/fs/aufs/xattr.c 2023-07-04 23:43:55.849649534 +0200
+@@ -0,0 +1,360 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2014-2022 Junjiro R. Okajima
+ */
+
+#include <linux/fs.h>
-+#include <linux/posix_acl_xattr.h>
+#include <linux/xattr.h>
+#include "aufs.h"
+
+ ssize_t ssz;
+ struct inode *h_idst;
+ struct dentry *h_dst_dentry, *h_src_dentry;
-+ struct user_namespace *h_dst_userns, *h_src_userns;
++ struct mnt_idmap *h_dst_idmap, *h_src_idmap;
+ struct posix_acl *acl;
+
+ is_acl = !!is_posix_acl_xattr(name);
-+ h_src_userns = mnt_user_ns(h_src->mnt);
++ h_src_idmap = mnt_idmap(h_src->mnt);
+ h_src_dentry = h_src->dentry;
+ if (is_acl) {
-+ acl = vfs_get_acl(h_src_userns, h_src_dentry, name);
++ acl = vfs_get_acl(h_src_idmap, h_src_dentry, name);
+ AuDebugOn(!acl);
+ if (unlikely(IS_ERR(acl))) {
+ err = PTR_ERR(acl);
+ goto out;
+ }
+ } else {
-+ ssz = vfs_getxattr_alloc(h_src_userns, h_src_dentry, name, buf,
++ ssz = vfs_getxattr_alloc(h_src_idmap, h_src_dentry, name, buf,
+ 0, GFP_NOFS);
+ if (unlikely(ssz <= 0)) {
+ err = ssz;
+ }
+
+ /* unlock it temporary */
-+ h_dst_userns = mnt_user_ns(h_dst->mnt);
++ h_dst_idmap = mnt_idmap(h_dst->mnt);
+ h_dst_dentry = h_dst->dentry;
+ h_idst = d_inode(h_dst_dentry);
+ inode_unlock(h_idst);
+ if (is_acl) {
-+ err = vfsub_set_acl(h_dst_userns, h_dst_dentry, name, acl);
++ err = vfsub_set_acl(h_dst_idmap, h_dst_dentry, name, acl);
+ posix_acl_release(acl);
+ } else
-+ err = vfsub_setxattr(h_dst_userns, h_dst_dentry, name, *buf,
++ err = vfsub_setxattr(h_dst_idmap, h_dst_dentry, name, *buf,
+ ssz, /*flags*/0);
+ inode_lock_nested(h_idst, AuLsc_I_CHILD2);
+ if (unlikely(err)) {
+ break;
+ case AU_XATTR_GET:
+ AuDebugOn(d_is_negative(h_path.dentry));
-+ err = vfs_getxattr(mnt_user_ns(h_path.mnt), h_path.dentry,
++ err = vfs_getxattr(mnt_idmap(h_path.mnt), h_path.dentry,
+ arg->u.get.name, arg->u.get.value,
+ arg->u.get.size);
+ break;
+}
+
+static int au_xattr_set(const struct xattr_handler *handler,
-+ struct user_namespace *userns,
++ struct mnt_idmap *idmap,
+ struct dentry *dentry, struct inode *inode,
+ const char *name, const void *value, size_t size,
+ int flags)
+};
+
+static const struct xattr_handler *au_xattr_handlers[] = {
-+#ifdef CONFIG_FS_POSIX_ACL
-+ &posix_acl_access_xattr_handler,
-+ &posix_acl_default_xattr_handler,
-+#endif
+ &au_xattr_handler, /* must be last */
+ NULL
+};
+}
diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
--- /usr/share/empty/fs/aufs/xino.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xino.c 2022-11-05 23:02:18.972555950 +0100
++++ linux/fs/aufs/xino.c 2023-04-24 08:13:40.972909448 +0200
@@ -0,0 +1,1926 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ }
+
+ /* no need to mnt_want_write() since we call dentry_open() later */
-+ err = vfs_create(mnt_user_ns(base->mnt), dir, path.dentry, 0666, NULL);
++ err = vfs_create(mnt_idmap(base->mnt), dir, path.dentry, 0666, NULL);
+ if (unlikely(err)) {
+ file = ERR_PTR(err);
+ pr_err("%pd create err %d\n", dentry, err);
+}
diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/linux/aufs_type.h
--- /usr/share/empty/include/uapi/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/include/uapi/linux/aufs_type.h 2023-02-20 21:05:51.959693785 +0100
++++ linux/include/uapi/linux/aufs_type.h 2023-07-04 23:43:55.849649534 +0200
@@ -0,0 +1,452 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+#include <limits.h>
+#endif /* __KERNEL__ */
+
-+#define AUFS_VERSION "6.x-rcN-20230109"
++#define AUFS_VERSION "6.x-rcN-20230515"
+
+/* todo? move this to linux-2.6.19/include/magic.h */
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
aufs6.x-rcN loopback patch
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 7a9928c6db9d..0bac486deea2 100644
+index 131294601819..56016fc9c9d8 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -54,7 +54,7 @@ struct loop_device {
struct inode *inode;
struct address_space *mapping;
int error;
-@@ -1031,6 +1055,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
- /* suppress uevents while reconfiguring the device */
- dev_set_uevent_suppress(disk_to_dev(lo->lo_disk), 1);
+@@ -1028,6 +1052,13 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
+ /* This is safe, since we have a reference from open(). */
+ __module_get(THIS_MODULE);
+ f = loop_real_file(file);
+ if (f) {
+ fput(virt_file);
/* This is safe: open() is still holding a reference. */
module_put(THIS_MODULE);
- goto done;
+ return error;
@@ -1154,6 +1188,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
static void __loop_clr_fd(struct loop_device *lo, bool release)
{
/* ---------------------------------------------------------------------- */
diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 2d30def9a580..84a83c480302 100644
+index 1e3054e5367d..2a780fcbdc75 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
-@@ -2252,6 +2252,10 @@ struct super_operations {
+@@ -1934,6 +1934,10 @@ struct super_operations {
struct shrink_control *);
long (*free_cached_objects)(struct super_block *,
struct shrink_control *);