]> git.pld-linux.org Git - packages/kernel.git/blobdiff - kernel-aufs5.patch
- 5.12.10
[packages/kernel.git] / kernel-aufs5.patch
index a1934da92605b6f3b57221ff0dc0cc353b5904ba..585f402a5e1a7eea1e50da8470be386a175bf97d 100644 (file)
@@ -1,11 +1,11 @@
 SPDX-License-Identifier: GPL-2.0
-aufs5.x-rcN kbuild patch
+aufs5.12 kbuild patch
 
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 708ba336e689..84eedbf8654e 100644
+index a55bda4233bbe..c4984b5bf340f 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
-@@ -266,6 +266,7 @@ source "fs/sysv/Kconfig"
+@@ -288,6 +288,7 @@ source "fs/sysv/Kconfig"
  source "fs/ufs/Kconfig"
  source "fs/erofs/Kconfig"
  source "fs/vboxsf/Kconfig"
@@ -14,7 +14,7 @@ index 708ba336e689..84eedbf8654e 100644
  endif # MISC_FILESYSTEMS
  
 diff --git a/fs/Makefile b/fs/Makefile
-index 505e51166973..d53a5678fd7d 100644
+index 3215fe205256d..7218277473b8f 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
 @@ -135,3 +135,4 @@ obj-$(CONFIG_EFIVAR_FS)            += efivarfs/
@@ -23,13 +23,13 @@ index 505e51166973..d53a5678fd7d 100644
  obj-$(CONFIG_ZONEFS_FS)               += zonefs/
 +obj-$(CONFIG_AUFS_FS)           += aufs/
 SPDX-License-Identifier: GPL-2.0
-aufs5.x-rcN base patch
+aufs5.12 base patch
 
 diff --git a/MAINTAINERS b/MAINTAINERS
-index fcd79fc38928..9751b7b48696 100644
+index 9450e052f1b13..f7db6edba5a37 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -2919,6 +2919,19 @@ F:      include/linux/audit.h
+@@ -2992,6 +2992,19 @@ F:      include/linux/audit.h
  F:    include/uapi/linux/audit.h
  F:    kernel/audit*
  
@@ -37,23 +37,23 @@ index fcd79fc38928..9751b7b48696 100644
 +M:    "J. R. Okajima" <hooanon05g@gmail.com>
 +L:    aufs-users@lists.sourceforge.net (members only)
 +L:    linux-unionfs@vger.kernel.org
++S:    Supported
 +W:    http://aufs.sourceforge.net
 +T:    git://github.com/sfjro/aufs4-linux.git
-+S:    Supported
-+F:    Documentation/filesystems/aufs/
 +F:    Documentation/ABI/testing/debugfs-aufs
 +F:    Documentation/ABI/testing/sysfs-aufs
++F:    Documentation/filesystems/aufs/
 +F:    fs/aufs/
 +F:    include/uapi/linux/aufs_type.h
 +
  AUXILIARY DISPLAY DRIVERS
- M:    Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
+ M:    Miguel Ojeda <ojeda@kernel.org>
  S:    Maintained
 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 739b372a5112..872e3b3a7693 100644
+index a370cde3ddd49..01ca256575fb2 100644
 --- a/drivers/block/loop.c
 +++ b/drivers/block/loop.c
-@@ -750,6 +750,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -761,6 +761,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
        return error;
  }
  
@@ -79,10 +79,10 @@ index 739b372a5112..872e3b3a7693 100644
  
  static ssize_t loop_attr_show(struct device *dev, char *page,
 diff --git a/fs/dcache.c b/fs/dcache.c
-index b280e07e162b..046000653e4d 100644
+index 7d24ff7eb2068..3caa7ab4b84f1 100644
 --- a/fs/dcache.c
 +++ b/fs/dcache.c
-@@ -1266,7 +1266,7 @@ enum d_walk_ret {
+@@ -1318,7 +1318,7 @@ enum d_walk_ret {
   *
   * The @enter() callbacks are called with d_lock held.
   */
@@ -92,10 +92,10 @@ index b280e07e162b..046000653e4d 100644
  {
        struct dentry *this_parent;
 diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 9bc167562ee8..b0935c67bd1e 100644
+index dfc72f15be7fc..d8a12eb63961d 100644
 --- a/fs/fcntl.c
 +++ b/fs/fcntl.c
-@@ -32,7 +32,7 @@
+@@ -33,7 +33,7 @@
  
  #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
  
@@ -104,7 +104,7 @@ index 9bc167562ee8..b0935c67bd1e 100644
  {
        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);
@@ -114,10 +114,10 @@ index 9bc167562ee8..b0935c67bd1e 100644
                return error;
  
 diff --git a/fs/inode.c b/fs/inode.c
-index 7d57068b6b7a..c5a5578773d4 100644
+index a047ab306f9a8..ba1df0895b69f 100644
 --- a/fs/inode.c
 +++ b/fs/inode.c
-@@ -1687,7 +1687,7 @@ EXPORT_SYMBOL(generic_update_time);
+@@ -1772,7 +1772,7 @@ EXPORT_SYMBOL(generic_update_time);
   * This does the actual work of updating an inodes time or version.  Must have
   * had called mnt_want_write() before calling this.
   */
@@ -127,10 +127,10 @@ index 7d57068b6b7a..c5a5578773d4 100644
        if (inode->i_op->update_time)
                return inode->i_op->update_time(inode, time, flags);
 diff --git a/fs/namespace.c b/fs/namespace.c
-index 85b5f7bea82e..c742051ba969 100644
+index 56bb5a5fdc0d0..540679d7e0434 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
-@@ -776,6 +776,12 @@ static inline int check_mnt(struct mount *mnt)
+@@ -807,6 +807,12 @@ static inline int check_mnt(struct mount *mnt)
        return mnt->mnt_ns == current->nsproxy->mnt_ns;
  }
  
@@ -143,44 +143,11 @@ index 85b5f7bea82e..c742051ba969 100644
  /*
   * vfsmount lock must be held for write
   */
-diff --git a/fs/read_write.c b/fs/read_write.c
-index 59d819c5b92e..bcb853105beb 100644
---- a/fs/read_write.c
-+++ b/fs/read_write.c
-@@ -498,6 +498,28 @@ static ssize_t __vfs_write(struct file *file, const char __user *p,
-               return -EINVAL;
- }
-+vfs_readf_t vfs_readf(struct file *file)
-+{
-+      const struct file_operations *fop = file->f_op;
-+
-+      if (fop->read)
-+              return fop->read;
-+      if (fop->read_iter)
-+              return new_sync_read;
-+      return ERR_PTR(-ENOSYS); /* doesn't have ->read(|_iter)() op */
-+}
-+
-+vfs_writef_t vfs_writef(struct file *file)
-+{
-+      const struct file_operations *fop = file->f_op;
-+
-+      if (fop->write)
-+              return fop->write;
-+      if (fop->write_iter)
-+              return new_sync_write;
-+      return ERR_PTR(-ENOSYS); /* doesn't have ->write(|_iter)() op */
-+}
-+
- ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
- {
-       mm_segment_t old_fs;
 diff --git a/fs/splice.c b/fs/splice.c
-index d671936d0aad..b1f536d03c09 100644
+index 5dbce4dcc1a7d..3e6ba363b7775 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
-@@ -849,8 +849,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+@@ -759,8 +759,8 @@ static int warn_unsupported(struct file *file, const char *op)
  /*
   * Attempt to initiate a splice from pipe to file.
   */
@@ -189,9 +156,9 @@ index d671936d0aad..b1f536d03c09 100644
 +long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
 +                  loff_t *ppos, size_t len, unsigned int flags)
  {
-       ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
-                               loff_t *, size_t, unsigned int);
-@@ -866,9 +866,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+       if (unlikely(!out->f_op->splice_write))
+               return warn_unsupported(out, "write");
+@@ -770,9 +770,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.
   */
@@ -202,10 +169,10 @@ index d671936d0aad..b1f536d03c09 100644
 +                struct pipe_inode_info *pipe, size_t len,
 +                unsigned int flags)
  {
-       ssize_t (*splice_read)(struct file *, loff_t *,
-                              struct pipe_inode_info *, size_t, unsigned int);
+       unsigned int p_space;
+       int ret;
 diff --git a/fs/sync.c b/fs/sync.c
-index 4d1ff010bc5a..457f4e4a5cc1 100644
+index 1373a610dc784..b7b5a0a0df6ff 100644
 --- a/fs/sync.c
 +++ b/fs/sync.c
 @@ -28,7 +28,7 @@
@@ -218,10 +185,10 @@ index 4d1ff010bc5a..457f4e4a5cc1 100644
        if (wait)
                sync_inodes_sb(sb);
 diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 3cd4fe6b845e..6d1e37a014f3 100644
+index ec8f3ddf4a6aa..4fa4b24535fde 100644
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
-@@ -1349,6 +1349,7 @@ extern void fasync_free(struct fasync_struct *);
+@@ -1332,6 +1332,7 @@ extern void fasync_free(struct fasync_struct *);
  /* can be called from interrupts */
  extern void kill_fasync(struct fasync_struct **, int, int);
  
@@ -229,7 +196,7 @@ index 3cd4fe6b845e..6d1e37a014f3 100644
  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);
-@@ -1841,6 +1842,7 @@ struct file_operations {
+@@ -1909,6 +1910,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);
@@ -237,20 +204,7 @@ index 3cd4fe6b845e..6d1e37a014f3 100644
        int (*flock) (struct file *, int, struct file_lock *);
        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);
-@@ -1911,6 +1913,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
-                             struct iovec *fast_pointer,
-                             struct iovec **ret_pointer);
-+typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *);
-+typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t,
-+                              loff_t *);
-+vfs_readf_t vfs_readf(struct file *file);
-+vfs_writef_t vfs_writef(struct file *file);
-+
- extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
- extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
- extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
-@@ -2343,6 +2351,7 @@ extern int current_umask(void);
+@@ -2428,6 +2430,7 @@ extern int current_umask(void);
  extern void ihold(struct inode * inode);
  extern void iput(struct inode *);
  extern int generic_update_time(struct inode *, struct timespec64 *, int);
@@ -258,19 +212,19 @@ index 3cd4fe6b845e..6d1e37a014f3 100644
  
  /* /sys/fs */
  extern struct kobject *fs_kobj;
-@@ -2627,6 +2636,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
-       return false;
+@@ -2668,6 +2671,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
  }
- #endif
+ void emergency_thaw_all(void);
 +extern int __sync_filesystem(struct super_block *, int);
  extern int sync_filesystem(struct super_block *);
  extern const struct file_operations def_blk_fops;
  extern const struct file_operations def_chr_fops;
 diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
-index 664f52c6dd4c..f2208851f527 100644
+index 7b7ebf2e28ec5..20c46305e057e 100644
 --- a/include/linux/lockdep.h
 +++ b/include/linux/lockdep.h
-@@ -331,6 +331,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
+@@ -248,6 +248,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
        return lock->key == key;
  }
  
@@ -279,27 +233,20 @@ index 664f52c6dd4c..f2208851f527 100644
  /*
   * Acquire a lock.
   *
-@@ -472,6 +474,7 @@ struct lockdep_map { };
- #define lockdep_depth(tsk)    (0)
-+#define lockdep_is_held(lock)                 (1)
- #define lockdep_is_held_type(l, r)            (1)
- #define lockdep_assert_held(l)                        do { (void)(l); } while (0)
 diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
-index 35942084cd40..24f5fd1a789d 100644
+index 8f882f5881e87..6b9808f098435 100644
 --- a/include/linux/mnt_namespace.h
 +++ b/include/linux/mnt_namespace.h
-@@ -6,11 +6,14 @@
- struct mnt_namespace;
+@@ -7,12 +7,15 @@ struct mnt_namespace;
  struct fs_struct;
  struct user_namespace;
+ struct ns_common;
 +struct vfsmount;
  
  extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
                struct user_namespace *, struct fs_struct *);
  extern void put_mnt_ns(struct mnt_namespace *ns);
+ extern struct ns_common *from_mnt_ns(struct mnt_namespace *);
  
 +extern int is_current_mnt_ns(struct vfsmount *mnt);
 +
@@ -307,10 +254,10 @@ index 35942084cd40..24f5fd1a789d 100644
  extern const struct file_operations proc_mountinfo_operations;
  extern const struct file_operations proc_mountstats_operations;
 diff --git a/include/linux/splice.h b/include/linux/splice.h
-index 74b4911ac16d..19789fbea567 100644
+index a55179fd60fc3..8e21c53cf8831 100644
 --- a/include/linux/splice.h
 +++ b/include/linux/splice.h
-@@ -87,4 +87,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
+@@ -93,4 +93,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
  
  extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
  extern const struct pipe_buf_operations default_pipe_buf_ops;
@@ -322,10 +269,10 @@ index 74b4911ac16d..19789fbea567 100644
 +                       unsigned int flags);
  #endif
 diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
-index 32406ef0d6a2..e52169c2086b 100644
+index f160f1c97ca1e..fe71c2737eb9e 100644
 --- a/kernel/locking/lockdep.c
 +++ b/kernel/locking/lockdep.c
-@@ -153,7 +153,7 @@ static
+@@ -188,7 +188,7 @@ static
  struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
  static DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
  
@@ -334,7 +281,7 @@ index 32406ef0d6a2..e52169c2086b 100644
  {
        unsigned int class_idx = hlock->class_idx;
  
-@@ -174,6 +174,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
+@@ -209,6 +209,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
         */
        return lock_classes + class_idx;
  }
@@ -343,13 +290,13 @@ index 32406ef0d6a2..e52169c2086b 100644
  #ifdef CONFIG_LOCK_STAT
  static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);
 SPDX-License-Identifier: GPL-2.0
-aufs5.x-rcN mmap patch
+aufs5.12 mmap patch
 
 diff --git a/fs/proc/base.c b/fs/proc/base.c
-index c7c64272b0fa..76d99aea5ae2 100644
+index 3851bfcdba56e..d632ddd5f5ee8 100644
 --- a/fs/proc/base.c
 +++ b/fs/proc/base.c
-@@ -2128,7 +2128,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
+@@ -2183,7 +2183,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
        rc = -ENOENT;
        vma = find_exact_vma(mm, vm_start, vm_end);
        if (vma && vma->vm_file) {
@@ -359,10 +306,10 @@ index c7c64272b0fa..76d99aea5ae2 100644
                rc = 0;
        }
 diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
-index 14c2badb8fd9..65afe5287e43 100644
+index 13452b32e2bd5..38acccfef9d49 100644
 --- a/fs/proc/nommu.c
 +++ b/fs/proc/nommu.c
-@@ -41,7 +41,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
+@@ -40,7 +40,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
        file = region->vm_file;
  
        if (file) {
@@ -375,10 +322,10 @@ index 14c2badb8fd9..65afe5287e43 100644
                ino = inode->i_ino;
        }
 diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 3ba9ae83bff5..397c33e0acbe 100644
+index e862cab695838..5c45041943a6f 100644
 --- a/fs/proc/task_mmu.c
 +++ b/fs/proc/task_mmu.c
-@@ -309,7 +309,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
+@@ -280,7 +280,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
        const char *name = NULL;
  
        if (file) {
@@ -390,7 +337,7 @@ index 3ba9ae83bff5..397c33e0acbe 100644
                dev = inode->i_sb->s_dev;
                ino = inode->i_ino;
                pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
-@@ -1819,7 +1822,7 @@ static int show_numa_map(struct seq_file *m, void *v)
+@@ -1861,7 +1864,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;
@@ -400,7 +347,7 @@ index 3ba9ae83bff5..397c33e0acbe 100644
        struct mempolicy *pol;
        char buffer[64];
 diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
-index 7907e6419e57..d17209cf52bc 100644
+index a6d21fc0033c6..02c2de31196e0 100644
 --- a/fs/proc/task_nommu.c
 +++ b/fs/proc/task_nommu.c
 @@ -155,7 +155,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
@@ -416,10 +363,10 @@ index 7907e6419e57..d17209cf52bc 100644
                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 52269e56c514..32aa6b1ea1d2 100644
+index 8ba434287387b..6d23d40ad1523 100644
 --- a/include/linux/mm.h
 +++ b/include/linux/mm.h
-@@ -1487,6 +1487,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
+@@ -1759,6 +1759,28 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
        unmap_mapping_range(mapping, holebegin, holelen, 0);
  }
  
@@ -449,10 +396,10 @@ index 52269e56c514..32aa6b1ea1d2 100644
                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 c28911c3afa8..23d069c0e171 100644
+index 6613b26a88946..e94df45b5483a 100644
 --- a/include/linux/mm_types.h
 +++ b/include/linux/mm_types.h
-@@ -267,6 +267,7 @@ struct vm_region {
+@@ -279,6 +279,7 @@ 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 */
@@ -460,7 +407,7 @@ index c28911c3afa8..23d069c0e171 100644
  
        int             vm_usage;       /* region usage count (access under nommu_region_sem) */
        bool            vm_icache_flushed : 1; /* true if the icache has been flushed for
-@@ -346,6 +347,7 @@ struct vm_area_struct {
+@@ -358,6 +359,7 @@ 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). */
@@ -469,49 +416,49 @@ index c28911c3afa8..23d069c0e171 100644
  
  #ifdef CONFIG_SWAP
 diff --git a/kernel/fork.c b/kernel/fork.c
-index 60a1295f4384..44682dd97ca6 100644
+index 426cd0c51f9eb..ea0ae494c6dde 100644
 --- a/kernel/fork.c
 +++ b/kernel/fork.c
-@@ -565,7 +565,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
+@@ -555,7 +555,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
                        struct inode *inode = file_inode(file);
                        struct address_space *mapping = file->f_mapping;
  
 -                      get_file(file);
 +                      vma_get_file(tmp);
                        if (tmp->vm_flags & VM_DENYWRITE)
-                               atomic_dec(&inode->i_writecount);
+                               put_write_access(inode);
                        i_mmap_lock_write(mapping);
 diff --git a/mm/Makefile b/mm/Makefile
-index 272e66039e70..c8ff3d955c27 100644
+index 72227b24a6168..5d03943b08e03 100644
 --- a/mm/Makefile
 +++ b/mm/Makefile
-@@ -43,7 +43,7 @@ obj-y                        := filemap.o mempool.o oom_kill.o fadvise.o \
-                          mm_init.o mmu_context.o percpu.o slab_common.o \
+@@ -52,7 +52,7 @@ obj-y                        := filemap.o mempool.o oom_kill.o fadvise.o \
+                          mm_init.o percpu.o slab_common.o \
                           compaction.o vmacache.o \
                           interval_tree.o list_lru.o workingset.o \
--                         debug.o gup.o $(mmu-y)
-+                         prfile.o debug.o gup.o $(mmu-y)
+-                         debug.o gup.o mmap_lock.o $(mmu-y)
++                         prfile.o debug.o gup.o mmap_lock.o $(mmu-y)
  
  # Give 'page_alloc' its own module-parameter namespace
  page-alloc-y := page_alloc.o
 diff --git a/mm/filemap.c b/mm/filemap.c
-index 1784478270e1..fb03735cd00e 100644
+index 6ce832dc59e73..8b7a71b6f0e6c 100644
 --- a/mm/filemap.c
 +++ b/mm/filemap.c
-@@ -2653,7 +2653,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
+@@ -3162,7 +3162,7 @@ vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
        vm_fault_t ret = VM_FAULT_LOCKED;
  
-       sb_start_pagefault(inode->i_sb);
+       sb_start_pagefault(mapping->host->i_sb);
 -      file_update_time(vmf->vma->vm_file);
 +      vma_file_update_time(vmf->vma);
        lock_page(page);
-       if (page->mapping != inode->i_mapping) {
+       if (page->mapping != mapping) {
                unlock_page(page);
 diff --git a/mm/mmap.c b/mm/mmap.c
-index d681a20eb4ea..36c80ae89cee 100644
+index 3f287599a7a30..eb36f1b18f048 100644
 --- a/mm/mmap.c
 +++ b/mm/mmap.c
-@@ -176,7 +176,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
+@@ -179,7 +179,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
        if (vma->vm_ops && vma->vm_ops->close)
                vma->vm_ops->close(vma);
        if (vma->vm_file)
@@ -520,7 +467,7 @@ index d681a20eb4ea..36c80ae89cee 100644
        mpol_put(vma_policy(vma));
        vm_area_free(vma);
        return next;
-@@ -907,7 +907,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
+@@ -949,7 +949,7 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
        if (remove_next) {
                if (file) {
                        uprobe_munmap(next, next->vm_start, next->vm_end);
@@ -529,17 +476,16 @@ index d681a20eb4ea..36c80ae89cee 100644
                }
                if (next->anon_vma)
                        anon_vma_merge(vma, next);
-@@ -1829,8 +1829,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
+@@ -1895,7 +1895,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
        return addr;
  
  unmap_and_free_vma:
+-      fput(vma->vm_file);
 +      vma_fput(vma);
        vma->vm_file = NULL;
--      fput(file);
  
        /* Undo any partial mapping done by a device driver. */
-       unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
-@@ -2659,7 +2659,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2755,7 +2755,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
                goto out_free_mpol;
  
        if (new->vm_file)
@@ -548,7 +494,7 @@ index d681a20eb4ea..36c80ae89cee 100644
  
        if (new->vm_ops && new->vm_ops->open)
                new->vm_ops->open(new);
-@@ -2678,7 +2678,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2774,7 +2774,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)
@@ -557,7 +503,7 @@ index d681a20eb4ea..36c80ae89cee 100644
        unlink_anon_vmas(new);
   out_free_mpol:
        mpol_put(vma_policy(new));
-@@ -2870,7 +2870,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -2967,7 +2967,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
        struct vm_area_struct *vma;
        unsigned long populate = 0;
        unsigned long ret = -EINVAL;
@@ -566,7 +512,7 @@ index d681a20eb4ea..36c80ae89cee 100644
  
        pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.rst.\n",
                     current->comm, current->pid);
-@@ -2945,10 +2945,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
+@@ -3042,10 +3042,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
                }
        }
  
@@ -574,7 +520,7 @@ index d681a20eb4ea..36c80ae89cee 100644
 +      vma_get_file(vma);
 +      file = vma->vm_file;
 +      prfile = vma->vm_prfile;
-       ret = do_mmap_pgoff(vma->vm_file, start, size,
+       ret = do_mmap(vma->vm_file, start, size,
                        prot, flags, pgoff, &populate, NULL);
 +      if (!IS_ERR_VALUE(ret) && file && prfile) {
 +              struct vm_area_struct *new_vma;
@@ -593,9 +539,9 @@ index d681a20eb4ea..36c80ae89cee 100644
 +      if (prfile)
 +              fput(prfile);
  out:
-       up_write(&mm->mmap_sem);
+       mmap_write_unlock(mm);
        if (populate)
-@@ -3239,7 +3256,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
+@@ -3332,7 +3349,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)
@@ -605,10 +551,10 @@ index d681a20eb4ea..36c80ae89cee 100644
                        new_vma->vm_ops->open(new_vma);
                vma_link(mm, new_vma, prev, rb_link, rb_parent);
 diff --git a/mm/nommu.c b/mm/nommu.c
-index bd2b4e5ef144..acdab5253263 100644
+index 5c9ab799c0e63..dd78905704c12 100644
 --- a/mm/nommu.c
 +++ b/mm/nommu.c
-@@ -563,7 +563,7 @@ static void __put_nommu_region(struct vm_region *region)
+@@ -533,7 +533,7 @@ static void __put_nommu_region(struct vm_region *region)
                up_write(&nommu_region_sem);
  
                if (region->vm_file)
@@ -617,7 +563,7 @@ index bd2b4e5ef144..acdab5253263 100644
  
                /* IO memory and memory shared directly out of the pagecache
                 * from ramfs/tmpfs mustn't be released here */
-@@ -695,7 +695,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
+@@ -665,7 +665,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)
@@ -626,7 +572,7 @@ index bd2b4e5ef144..acdab5253263 100644
        put_nommu_region(vma->vm_region);
        vm_area_free(vma);
  }
-@@ -1218,7 +1218,7 @@ unsigned long do_mmap(struct file *file,
+@@ -1188,7 +1188,7 @@ unsigned long do_mmap(struct file *file,
                                        goto error_just_free;
                                }
                        }
@@ -635,7 +581,7 @@ index bd2b4e5ef144..acdab5253263 100644
                        kmem_cache_free(vm_region_jar, region);
                        region = pregion;
                        result = start;
-@@ -1295,10 +1295,10 @@ unsigned long do_mmap(struct file *file,
+@@ -1265,10 +1265,10 @@ unsigned long do_mmap(struct file *file,
        up_write(&nommu_region_sem);
  error:
        if (region->vm_file)
@@ -650,7 +596,7 @@ index bd2b4e5ef144..acdab5253263 100644
  
 diff --git a/mm/prfile.c b/mm/prfile.c
 new file mode 100644
-index 000000000000..00d51187c325
+index 0000000000000..00d51187c3250
 --- /dev/null
 +++ b/mm/prfile.c
 @@ -0,0 +1,86 @@
@@ -741,13 +687,13 @@ index 000000000000..00d51187c325
 +}
 +#endif /* !CONFIG_MMU */
 SPDX-License-Identifier: GPL-2.0
-aufs5.x-rcN standalone patch
+aufs5.12 standalone patch
 
 diff --git a/fs/dcache.c b/fs/dcache.c
-index 046000653e4d..15aa871d1b45 100644
+index 3caa7ab4b84f1..00e97c9ae7c45 100644
 --- a/fs/dcache.c
 +++ b/fs/dcache.c
-@@ -1371,6 +1371,7 @@ void d_walk(struct dentry *parent, void *data,
+@@ -1423,6 +1423,7 @@ void d_walk(struct dentry *parent, void *data,
        seq = 1;
        goto again;
  }
@@ -755,7 +701,7 @@ index 046000653e4d..15aa871d1b45 100644
  
  struct check_mount {
        struct vfsmount *mnt;
-@@ -2916,6 +2917,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
+@@ -2968,6 +2969,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
  
        write_sequnlock(&rename_lock);
  }
@@ -764,10 +710,10 @@ index 046000653e4d..15aa871d1b45 100644
  /**
   * d_ancestor - search for an ancestor
 diff --git a/fs/exec.c b/fs/exec.c
-index db17be51b112..4bb61917a29a 100644
+index 18594f11c31fe..ac38c0424d2a3 100644
 --- a/fs/exec.c
 +++ b/fs/exec.c
-@@ -109,6 +109,7 @@ bool path_noexec(const struct path *path)
+@@ -114,6 +114,7 @@ bool path_noexec(const struct path *path)
        return (path->mnt->mnt_flags & MNT_NOEXEC) ||
               (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
  }
@@ -776,10 +722,10 @@ index db17be51b112..4bb61917a29a 100644
  #ifdef CONFIG_USELIB
  /*
 diff --git a/fs/fcntl.c b/fs/fcntl.c
-index b0935c67bd1e..07251ba86c31 100644
+index d8a12eb63961d..0532996186311 100644
 --- a/fs/fcntl.c
 +++ b/fs/fcntl.c
-@@ -85,6 +85,7 @@ int setfl(int fd, struct file *filp, unsigned long arg)
+@@ -86,6 +86,7 @@ int setfl(int fd, struct file *filp, unsigned long arg)
   out:
        return error;
  }
@@ -788,10 +734,10 @@ index b0935c67bd1e..07251ba86c31 100644
  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 30d55c9a1744..34b9bbf4c556 100644
+index 45437f8e1003e..786af52904fcf 100644
 --- a/fs/file_table.c
 +++ b/fs/file_table.c
-@@ -162,6 +162,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
+@@ -161,6 +161,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
        }
        return ERR_PTR(-ENFILE);
  }
@@ -808,22 +754,22 @@ index 30d55c9a1744..34b9bbf4c556 100644
  void __init files_init(void)
  {
 diff --git a/fs/inode.c b/fs/inode.c
-index c5a5578773d4..5995e737f64a 100644
+index ba1df0895b69f..0672530acf7dd 100644
 --- a/fs/inode.c
 +++ b/fs/inode.c
-@@ -1693,6 +1693,7 @@ int update_time(struct inode *inode, struct timespec64 *time, int flags)
+@@ -1778,6 +1778,7 @@ int update_time(struct inode *inode, struct timespec64 *time, int flags)
                return inode->i_op->update_time(inode, time, flags);
        return generic_update_time(inode, time, flags);
  }
 +EXPORT_SYMBOL_GPL(update_time);
  
  /**
-  *    touch_atime     -       update the access time
+  *    atime_needs_update      -       update the access time
 diff --git a/fs/namespace.c b/fs/namespace.c
-index c742051ba969..e02a680b7fe9 100644
+index 540679d7e0434..74957d5edaa86 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
-@@ -431,6 +431,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
+@@ -438,6 +438,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
        mnt_dec_writers(real_mount(mnt));
        preempt_enable();
  }
@@ -831,7 +777,7 @@ index c742051ba969..e02a680b7fe9 100644
  
  /**
   * mnt_drop_write - give up write access to a mount
-@@ -781,6 +782,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
+@@ -812,6 +813,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
  {
        return check_mnt(real_mount(mnt));
  }
@@ -839,7 +785,7 @@ index c742051ba969..e02a680b7fe9 100644
  
  /*
   * vfsmount lock must be held for write
-@@ -1903,6 +1905,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
+@@ -1985,6 +1987,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
        }
        return 0;
  }
@@ -848,10 +794,10 @@ index c742051ba969..e02a680b7fe9 100644
  static void lock_mnt_tree(struct mount *mnt)
  {
 diff --git a/fs/notify/group.c b/fs/notify/group.c
-index 133f723aca07..0b9f7f6d8390 100644
+index ffd723ffe46de..ec6172836b6f6 100644
 --- a/fs/notify/group.c
 +++ b/fs/notify/group.c
-@@ -99,6 +99,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
+@@ -100,6 +100,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
  {
        refcount_inc(&group->refcnt);
  }
@@ -860,10 +806,10 @@ index 133f723aca07..0b9f7f6d8390 100644
  /*
   * Drop a reference to a group.  Free it if it's through.
 diff --git a/fs/open.c b/fs/open.c
-index 0788b3715731..cec8ceac6f16 100644
+index e53af13b5835f..f37da065e6544 100644
 --- a/fs/open.c
 +++ b/fs/open.c
-@@ -65,6 +65,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
+@@ -65,6 +65,7 @@ int do_truncate(struct user_namespace *mnt_userns, struct dentry *dentry,
        inode_unlock(dentry->d_inode);
        return ret;
  }
@@ -872,35 +818,19 @@ index 0788b3715731..cec8ceac6f16 100644
  long vfs_truncate(const struct path *path, loff_t length)
  {
 diff --git a/fs/read_write.c b/fs/read_write.c
-index bcb853105beb..e54db6078e3f 100644
+index 9db7adf160d20..8dc93a57a933f 100644
 --- a/fs/read_write.c
 +++ b/fs/read_write.c
-@@ -468,6 +468,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
+@@ -503,6 +503,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
+       inc_syscr(current);
        return ret;
  }
 +EXPORT_SYMBOL_GPL(vfs_read);
  
  static ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
  {
-@@ -508,6 +509,7 @@ vfs_readf_t vfs_readf(struct file *file)
-               return new_sync_read;
-       return ERR_PTR(-ENOSYS); /* doesn't have ->read(|_iter)() op */
- }
-+EXPORT_SYMBOL_GPL(vfs_readf);
- vfs_writef_t vfs_writef(struct file *file)
- {
-@@ -519,6 +521,7 @@ vfs_writef_t vfs_writef(struct file *file)
-               return new_sync_write;
-       return ERR_PTR(-ENOSYS); /* doesn't have ->write(|_iter)() op */
- }
-+EXPORT_SYMBOL_GPL(vfs_writef);
- ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
- {
-@@ -588,6 +591,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
+@@ -613,6 +614,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
+       file_end_write(file);
        return ret;
  }
 +EXPORT_SYMBOL_GPL(vfs_write);
@@ -908,27 +838,27 @@ index bcb853105beb..e54db6078e3f 100644
  /* 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 b1f536d03c09..0872306175b4 100644
+index 3e6ba363b7775..7c1be373eb7cd 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
-@@ -862,6 +862,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-       return splice_write(pipe, out, ppos, len, flags);
+@@ -766,6 +766,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);
  }
 +EXPORT_SYMBOL_GPL(do_splice_from);
  
  /*
   * Attempt to initiate a splice from a file to a pipe.
-@@ -891,6 +892,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
-       return splice_read(in, ppos, pipe, len, flags);
+@@ -795,6 +796,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);
  }
 +EXPORT_SYMBOL_GPL(do_splice_to);
  
  /**
   * splice_direct_to_actor - splices data directly between two non-pipes
 diff --git a/fs/sync.c b/fs/sync.c
-index 457f4e4a5cc1..67c66358f3fe 100644
+index b7b5a0a0df6ff..fa5c7fba7f1ba 100644
 --- a/fs/sync.c
 +++ b/fs/sync.c
 @@ -39,6 +39,7 @@ int __sync_filesystem(struct super_block *sb, int wait)
@@ -940,10 +870,10 @@ index 457f4e4a5cc1..67c66358f3fe 100644
  /*
   * Write out and wait upon all dirty data associated with this
 diff --git a/fs/xattr.c b/fs/xattr.c
-index 90dd78f0eb27..40b01dd1b14a 100644
+index b3444e06cded4..7b0f851b63d75 100644
 --- a/fs/xattr.c
 +++ b/fs/xattr.c
-@@ -296,6 +296,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
+@@ -383,6 +383,7 @@ vfs_getxattr_alloc(struct user_namespace *mnt_userns, struct dentry *dentry,
        *xattr_value = value;
        return error;
  }
@@ -952,10 +882,10 @@ index 90dd78f0eb27..40b01dd1b14a 100644
  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 e52169c2086b..d9bc5cbe9078 100644
+index fe71c2737eb9e..185531f89239a 100644
 --- a/kernel/locking/lockdep.c
 +++ b/kernel/locking/lockdep.c
-@@ -174,6 +174,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
+@@ -209,6 +209,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
         */
        return lock_classes + class_idx;
  }
@@ -964,19 +894,19 @@ index e52169c2086b..d9bc5cbe9078 100644
  
  #ifdef CONFIG_LOCK_STAT
 diff --git a/kernel/task_work.c b/kernel/task_work.c
-index 0fef395662a6..83fb1ecfc33d 100644
+index 9cde961875c0a..ac8c79dc81813 100644
 --- a/kernel/task_work.c
 +++ b/kernel/task_work.c
-@@ -116,3 +116,4 @@ void task_work_run(void)
+@@ -143,3 +143,4 @@ void task_work_run(void)
                } while (work);
        }
  }
 +EXPORT_SYMBOL_GPL(task_work_run);
 diff --git a/security/security.c b/security/security.c
-index 565bc9b67276..248a63945e9f 100644
+index 5ac96b16f8fab..46d334d6ac1f6 100644
 --- a/security/security.c
 +++ b/security/security.c
-@@ -1068,6 +1068,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
+@@ -1102,6 +1102,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
                return 0;
        return call_int_hook(path_rmdir, 0, dir, dentry);
  }
@@ -984,7 +914,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_path_unlink(const struct path *dir, struct dentry *dentry)
  {
-@@ -1084,6 +1085,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
+@@ -1118,6 +1119,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);
  }
@@ -992,7 +922,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
                       struct dentry *new_dentry)
-@@ -1092,6 +1094,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
+@@ -1126,6 +1128,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);
  }
@@ -1000,7 +930,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
                         const struct path *new_dir, struct dentry *new_dentry,
-@@ -1119,6 +1122,7 @@ int security_path_truncate(const struct path *path)
+@@ -1153,6 +1156,7 @@ int security_path_truncate(const struct path *path)
                return 0;
        return call_int_hook(path_truncate, 0, path);
  }
@@ -1008,7 +938,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_path_chmod(const struct path *path, umode_t mode)
  {
-@@ -1126,6 +1130,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
+@@ -1160,6 +1164,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
                return 0;
        return call_int_hook(path_chmod, 0, path, mode);
  }
@@ -1016,7 +946,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
  {
-@@ -1133,6 +1138,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
+@@ -1167,6 +1172,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);
  }
@@ -1024,7 +954,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_path_chroot(const struct path *path)
  {
-@@ -1233,6 +1239,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -1267,6 +1273,7 @@ int security_inode_permission(struct inode *inode, int mask)
                return 0;
        return call_int_hook(inode_permission, 0, inode, mask);
  }
@@ -1032,7 +962,7 @@ index 565bc9b67276..248a63945e9f 100644
  
  int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
  {
-@@ -1410,6 +1417,7 @@ int security_file_permission(struct file *file, int mask)
+@@ -1464,6 +1471,7 @@ int security_file_permission(struct file *file, int mask)
  
        return fsnotify_perm(file, mask);
  }
@@ -1042,7 +972,7 @@ index 565bc9b67276..248a63945e9f 100644
  {
 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       2019-07-11 15:42:14.455570938 +0200
++++ linux/Documentation/ABI/testing/debugfs-aufs       2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,55 @@
 +What:         /debug/aufs/si_<id>/
 +Date:         March 2009
@@ -1074,7 +1004,7 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/debugfs-aufs linux/Document
 +              When the aufs mount option 'noxino' is specified, it
 +              will be empty. About XINO files, see the aufs manual.
 +
-+What:         /debug/aufs/si_<id>/xi0, xi1 ... xiN and xiN-N
++What:         /debug/aufs/si_<id>/xi<branch-index>
 +Date:         March 2009
 +Contact:      J. R. Okajima <hooanon05g@gmail.com>
 +Description:
@@ -1101,7 +1031,7 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/debugfs-aufs linux/Document
 +              will be empty. About XINO files, see the aufs manual.
 diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentation/ABI/testing/sysfs-aufs
 --- /usr/share/empty/Documentation/ABI/testing/sysfs-aufs      1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/ABI/testing/sysfs-aufs 2019-07-11 15:42:14.455570938 +0200
++++ linux/Documentation/ABI/testing/sysfs-aufs 2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,31 @@
 +What:         /sys/fs/aufs/si_<id>/
 +Date:         March 2009
@@ -1111,14 +1041,14 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentat
 +              per aufs mount, where <id> is a unique id generated
 +              internally.
 +
-+What:         /sys/fs/aufs/si_<id>/br0, br1 ... brN
++What:         /sys/fs/aufs/si_<id>/br<idx>
 +Date:         March 2009
 +Contact:      J. R. Okajima <hooanon05g@gmail.com>
 +Description:
 +              It shows the abolute path of a member directory (which
 +              is called branch) in aufs, and its permission.
 +
-+What:         /sys/fs/aufs/si_<id>/brid0, brid1 ... bridN
++What:         /sys/fs/aufs/si_<id>/brid<idx>
 +Date:         July 2013
 +Contact:      J. R. Okajima <hooanon05g@gmail.com>
 +Description:
@@ -1136,7 +1066,7 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentat
 +              will be empty. About XINO files, see the aufs manual.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt linux/Documentation/filesystems/aufs/design/01intro.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/01intro.txt    2020-01-27 10:57:18.162204582 +0100
++++ linux/Documentation/filesystems/aufs/design/01intro.txt    2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,171 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -1311,7 +1241,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt lin
 +about it. But currently I have implemented it in kernel space.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt linux/Documentation/filesystems/aufs/design/02struct.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt        1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/02struct.txt   2020-01-27 10:57:18.162204582 +0100
++++ linux/Documentation/filesystems/aufs/design/02struct.txt   2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,258 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -1573,7 +1503,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt li
 +For this purpose, use "aumvdown" command in aufs-util.git.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.txt linux/Documentation/filesystems/aufs/design/03atomic_open.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.txt   1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/03atomic_open.txt      2020-01-27 10:57:18.162204582 +0100
++++ linux/Documentation/filesystems/aufs/design/03atomic_open.txt      2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,85 @@
 +
 +# Copyright (C) 2015-2020 Junjiro R. Okajima
@@ -1662,7 +1592,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.t
 +       be implemented in aufs, but not all I am afraid.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt linux/Documentation/filesystems/aufs/design/03lookup.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt        1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/03lookup.txt   2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/03lookup.txt   2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,113 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -1779,7 +1709,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt li
 +   by over-mounting something (or another method).
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt linux/Documentation/filesystems/aufs/design/04branch.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt        1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/04branch.txt   2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/04branch.txt   2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,74 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -1857,7 +1787,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt li
 +    same named entry on the upper branch.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.txt linux/Documentation/filesystems/aufs/design/05wbr_policy.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.txt    1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/05wbr_policy.txt       2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/05wbr_policy.txt       2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,64 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -1925,7 +1855,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.tx
 +  copyup policy.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot linux/Documentation/filesystems/aufs/design/06dirren.dot
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot        1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06dirren.dot   2019-07-11 15:42:14.458904362 +0200
++++ linux/Documentation/filesystems/aufs/design/06dirren.dot   2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,31 @@
 +
 +// to view this graph, run dot(1) command in GRAPHVIZ.
@@ -1960,7 +1890,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot li
 +}
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt linux/Documentation/filesystems/aufs/design/06dirren.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt        1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06dirren.txt   2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/06dirren.txt   2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,102 @@
 +
 +# Copyright (C) 2017-2020 Junjiro R. Okajima
@@ -2066,7 +1996,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt li
 +equivalen to udba=reval case.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt linux/Documentation/filesystems/aufs/design/06fhsm.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt  1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06fhsm.txt     2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/06fhsm.txt     2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,120 @@
 +
 +# Copyright (C) 2011-2020 Junjiro R. Okajima
@@ -2190,7 +2120,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt linu
 +should restore the original file state after an error happens.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt linux/Documentation/filesystems/aufs/design/06mmap.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt  1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06mmap.txt     2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/06mmap.txt     2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,72 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -2266,7 +2196,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt linu
 +I have to give up this "looks-smater" approach.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt linux/Documentation/filesystems/aufs/design/06xattr.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06xattr.txt    2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/06xattr.txt    2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,96 @@
 +
 +# Copyright (C) 2014-2020 Junjiro R. Okajima
@@ -2366,7 +2296,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt lin
 +now, aufs implements the branch attributes to ignore the error.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt linux/Documentation/filesystems/aufs/design/07export.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt        1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/07export.txt   2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/07export.txt   2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,58 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -2428,7 +2358,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt li
 +  lookup_one_len(), vfs_getattr(), encode_fh() and others.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt linux/Documentation/filesystems/aufs/design/08shwh.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt  1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/08shwh.txt     2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/08shwh.txt     2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,52 @@
 +
 +# Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -2484,7 +2414,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt linu
 +initramfs will use it to replace the old one at the next boot.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt linux/Documentation/filesystems/aufs/design/10dynop.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/10dynop.txt    2020-01-27 10:57:18.165538015 +0100
++++ linux/Documentation/filesystems/aufs/design/10dynop.txt    2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,47 @@
 +
 +# Copyright (C) 2010-2020 Junjiro R. Okajima
@@ -2535,7 +2465,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt lin
 +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        2020-01-23 09:59:36.748660743 +0100
++++ linux/Documentation/filesystems/aufs/README        2021-05-02 20:15:14.666670785 +0200
 @@ -0,0 +1,401 @@
 +
 +Aufs5 -- advanced multi layered unification filesystem version 5.x
@@ -2940,7 +2870,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documenta
 +# End: ;
 diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
 --- /usr/share/empty/fs/aufs/aufs.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/aufs.h       2020-01-27 10:57:18.165538015 +0100
++++ linux/fs/aufs/aufs.h       2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,62 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -3006,8 +2936,8 @@ diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
 +#endif /* __AUFS_H__ */
 diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 --- /usr/share/empty/fs/aufs/branch.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.c     2020-01-27 10:57:18.165538015 +0100
-@@ -0,0 +1,1428 @@
++++ linux/fs/aufs/branch.c     2021-05-02 20:15:14.670004120 +0200
+@@ -0,0 +1,1427 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -4300,11 +4230,10 @@ diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 +              spin_unlock(&hf->f_lock);
 +              if (writer) {
 +                      h_inode = file_inode(hf);
++                      if (hf->f_mode & FMODE_READ)
++                              i_readcount_inc(h_inode);
 +                      put_write_access(h_inode);
 +                      __mnt_drop_write(hf->f_path.mnt);
-+                      if ((hf->f_mode & (FMODE_READ | FMODE_WRITE))
-+                          == FMODE_READ)
-+                              i_readcount_inc(h_inode);
 +              }
 +      }
 +
@@ -4438,8 +4367,8 @@ diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 +}
 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     2020-01-27 10:57:18.165538015 +0100
-@@ -0,0 +1,366 @@
++++ linux/fs/aufs/branch.h     2021-05-02 20:15:14.670004120 +0200
+@@ -0,0 +1,375 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -4588,6 +4517,11 @@ diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 +      return br->br_path.dentry;
 +}
 +
++static inline struct user_namespace *au_br_userns(struct au_branch *br)
++{
++      return mnt_user_ns(br->br_path.mnt);
++}
++
 +static inline struct super_block *au_br_sb(struct au_branch *br)
 +{
 +      return au_br_mnt(br)->mnt_sb;
@@ -4683,10 +4617,8 @@ diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 +               ino_t *ino);
 +int au_xino_write(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino,
 +                ino_t ino);
-+ssize_t xino_fread(vfs_readf_t func, struct file *file, void *buf, size_t size,
-+                 loff_t *pos);
-+ssize_t xino_fwrite(vfs_writef_t func, struct file *file, void *buf,
-+                  size_t size, loff_t *pos);
++ssize_t xino_fread(struct file *file, void *buf, size_t size, loff_t *pos);
++ssize_t xino_fwrite(struct file *file, void *buf, size_t size, loff_t *pos);
 +
 +int au_xib_trunc(struct super_block *sb);
 +int au_xino_trunc(struct super_block *sb, aufs_bindex_t bindex, int idx_begin);
@@ -4749,6 +4681,12 @@ diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 +}
 +
 +static inline
++struct user_namespace *au_sbr_userns(struct super_block *sb, aufs_bindex_t bindex)
++{
++      return au_br_userns(au_sbr(sb, bindex));
++}
++
++static inline
 +struct super_block *au_sbr_sb(struct super_block *sb, aufs_bindex_t bindex)
 +{
 +      return au_br_sb(au_sbr(sb, bindex));
@@ -4808,7 +4746,7 @@ diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 +#endif /* __AUFS_BRANCH_H__ */
 diff -urN /usr/share/empty/fs/aufs/conf.mk linux/fs/aufs/conf.mk
 --- /usr/share/empty/fs/aufs/conf.mk   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/conf.mk      2019-07-11 15:42:14.462237786 +0200
++++ linux/fs/aufs/conf.mk      2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,40 @@
 +# SPDX-License-Identifier: GPL-2.0
 +
@@ -4852,8 +4790,8 @@ diff -urN /usr/share/empty/fs/aufs/conf.mk linux/fs/aufs/conf.mk
 +-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       2020-01-27 10:57:18.165538015 +0100
-@@ -0,0 +1,1458 @@
++++ linux/fs/aufs/cpup.c       2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,1457 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -5020,7 +4958,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +};
 +
 +static noinline_for_stack
-+int cpup_iattr(struct dentry *dst, aufs_bindex_t bindex, struct dentry *h_src,
++int cpup_iattr(struct dentry *dst, aufs_bindex_t bindex, struct path *h_src,
 +             struct au_cpup_reg_attr *h_src_attr)
 +{
 +      int err, sbits, icex;
@@ -5032,11 +4970,11 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      struct kstat *h_st;
 +      struct au_branch *br;
 +
-+      h_path.dentry = au_h_dptr(dst, bindex);
-+      h_idst = d_inode(h_path.dentry);
 +      br = au_sbr(dst->d_sb, bindex);
 +      h_path.mnt = au_br_mnt(br);
-+      h_isrc = d_inode(h_src);
++      h_path.dentry = au_h_dptr(dst, bindex);
++      h_idst = d_inode(h_path.dentry);
++      h_isrc = d_inode(h_src->dentry);
 +      ia.ia_valid = ATTR_FORCE | ATTR_UID | ATTR_GID
 +              | ATTR_ATIME | ATTR_MTIME
 +              | ATTR_ATIME_SET | ATTR_MTIME_SET;
@@ -5080,7 +5018,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      if (!err) {
 +              mnt_flags = au_mntflags(dst->d_sb);
 +              verbose = !!au_opt_test(mnt_flags, VERBOSE);
-+              err = au_cpup_xattr(h_path.dentry, h_src, icex, verbose);
++              err = au_cpup_xattr(&h_path, h_src, icex, verbose);
 +      }
 +
 +      return err;
@@ -5425,32 +5363,19 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +static int au_do_cpup_symlink(struct path *h_path, struct dentry *h_src,
 +                            struct inode *h_dir)
 +{
-+      int err, symlen;
-+      mm_segment_t old_fs;
-+      union {
-+              char *k;
-+              char __user *u;
-+      } sym;
++      int err;
++      DEFINE_DELAYED_CALL(done);
++      const char *sym;
 +
-+      err = -ENOMEM;
-+      sym.k = (void *)__get_free_page(GFP_NOFS);
-+      if (unlikely(!sym.k))
++      sym = vfs_get_link(h_src, &done);
++      err = PTR_ERR(sym);
++      if (IS_ERR(sym))
 +              goto out;
 +
-+      /* unnecessary to support mmap_sem since symlink is not mmap-able */
-+      old_fs = get_fs();
-+      set_fs(KERNEL_DS);
-+      symlen = vfs_readlink(h_src, sym.u, PATH_MAX);
-+      err = symlen;
-+      set_fs(old_fs);
-+
-+      if (symlen > 0) {
-+              sym.k[symlen] = 0;
-+              err = vfsub_symlink(h_dir, h_path, sym.k);
-+      }
-+      free_page((unsigned long)sym.k);
++      err = vfsub_symlink(h_dir, h_path, sym);
 +
 +out:
++      do_delayed_call(&done);
 +      return err;
 +}
 +
@@ -5463,16 +5388,18 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      int err;
 +      struct dentry *h_dentry;
 +      struct inode *h_inode;
++      struct user_namespace *h_userns;
 +
++      h_userns = mnt_user_ns(h_path->mnt);
 +      h_dentry = h_path->dentry;
 +      h_inode = d_inode(h_dentry);
 +      /* forget_all_cached_acls(h_inode)); */
-+      err = vfsub_removexattr(h_dentry, XATTR_NAME_POSIX_ACL_ACCESS);
++      err = vfsub_removexattr(h_userns, h_dentry, XATTR_NAME_POSIX_ACL_ACCESS);
 +      AuTraceErr(err);
 +      if (err == -EOPNOTSUPP)
 +              err = 0;
 +      if (!err)
-+              err = vfsub_acl_chmod(h_inode, mode);
++              err = vfsub_acl_chmod(h_userns, h_inode, mode);
 +
 +      AuTraceErr(err);
 +      return err;
@@ -5483,8 +5410,11 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +{
 +      int err;
 +      struct inode *dir, *inode;
++      struct user_namespace *h_userns;
 +
-+      err = vfsub_removexattr(h_path->dentry, XATTR_NAME_POSIX_ACL_DEFAULT);
++      h_userns = mnt_user_ns(h_path->mnt);
++      err = vfsub_removexattr(h_userns, h_path->dentry,
++                              XATTR_NAME_POSIX_ACL_DEFAULT);
 +      AuTraceErr(err);
 +      if (err == -EOPNOTSUPP)
 +              err = 0;
@@ -5565,7 +5495,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      case S_IFCHR:
 +      case S_IFBLK:
 +              AuDebugOn(!capable(CAP_MKNOD));
-+              /*FALLTHROUGH*/
++              fallthrough;
 +      case S_IFIFO:
 +      case S_IFSOCK:
 +              err = vfsub_mknod(h_dir, &h_path, mode, h_inode->i_rdev);
@@ -5665,6 +5595,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      struct inode *dst_inode, *h_dir, *inode, *delegated, *src_inode;
 +      struct super_block *sb;
 +      struct au_branch *br;
++      struct path h_src_path;
 +      /* to reduce stack size */
 +      struct {
 +              struct au_dtime dt;
@@ -5756,7 +5687,9 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      /* todo: necessary? */
 +      /* au_pin_hdir_unlock(cpg->pin); */
 +
-+      err = cpup_iattr(cpg->dentry, cpg->bdst, h_src, &a->h_src_attr);
++      h_src_path.dentry = h_src;
++      h_src_path.mnt = au_sbr_mnt(sb, cpg->bsrc);
++      err = cpup_iattr(cpg->dentry, cpg->bdst, &h_src_path, &a->h_src_attr);
 +      if (unlikely(err)) {
 +              /* todo: necessary? */
 +              /* au_pin_hdir_relock(cpg->pin); */ /* ignore an error */
@@ -5958,6 +5891,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      struct dentry *dentry, *parent;
 +      struct file *h_file;
 +      struct inode *h_dir;
++      struct user_namespace *h_userns;
 +
 +      dentry = cpg->dentry;
 +      h_file = NULL;
@@ -5971,7 +5905,8 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +
 +      parent = dget_parent(dentry);
 +      h_dir = au_h_iptr(d_inode(parent), cpg->bdst);
-+      if (!au_test_h_perm_sio(h_dir, MAY_EXEC | MAY_WRITE)
++      h_userns = au_sbr_userns(dentry->d_sb, cpg->bdst);
++      if (!au_test_h_perm_sio(h_userns, h_dir, MAY_EXEC | MAY_WRITE)
 +          && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode))
 +              err = au_cpup_simple(cpg);
 +      else {
@@ -6141,6 +6076,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +      struct inode *dir, *h_dir, *h_tmpdir;
 +      struct au_wbr *wbr;
 +      struct au_pin wh_pin, *pin_orig;
++      struct user_namespace *h_userns;
 +
 +      dentry = cpg->dentry;
 +      bdst = cpg->bdst;
@@ -6169,7 +6105,8 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +              cpg->pin = &wh_pin;
 +      }
 +
-+      if (!au_test_h_perm_sio(h_tmpdir, MAY_EXEC | MAY_WRITE)
++      h_userns = au_sbr_userns(dentry->d_sb, bdst);
++      if (!au_test_h_perm_sio(h_userns, h_tmpdir, MAY_EXEC | MAY_WRITE)
 +          && !au_cpup_sio_test(cpg->pin, d_inode(dentry)->i_mode))
 +              err = au_cpup_wh(cpg, file);
 +      else {
@@ -6314,7 +6251,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +}
 diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
 --- /usr/share/empty/fs/aufs/cpup.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.h       2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/cpup.h       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,100 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -6418,7 +6355,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
 +#endif /* __AUFS_CPUP_H__ */
 diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
 --- /usr/share/empty/fs/aufs/dbgaufs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.c    2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dbgaufs.c    2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,526 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -6948,7 +6885,7 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
 --- /usr/share/empty/fs/aufs/dbgaufs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.h    2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dbgaufs.h    2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,53 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -7005,7 +6942,7 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
 +#endif /* __DBGAUFS_H__ */
 diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
 --- /usr/share/empty/fs/aufs/dcsub.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.c      2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dcsub.c      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,225 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -7234,7 +7171,7 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
 --- /usr/share/empty/fs/aufs/dcsub.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.h      2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dcsub.h      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,137 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -7375,7 +7312,7 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
 +#endif /* __AUFS_DCSUB_H__ */
 diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
 --- /usr/share/empty/fs/aufs/debug.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.c      2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/debug.c      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,441 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -7820,7 +7757,7 @@ diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
 +}
 diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
 --- /usr/share/empty/fs/aufs/debug.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.h      2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/debug.h      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,226 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -8050,8 +7987,8 @@ diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
 +#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     2020-01-27 10:57:18.168871450 +0100
-@@ -0,0 +1,1154 @@
++++ linux/fs/aufs/dentry.c     2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,1160 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -8089,6 +8026,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +      struct dentry *h_dentry;
 +      struct inode *h_inode;
 +      struct au_branch *br;
++      struct user_namespace *h_userns;
 +      int wh_found, opq;
 +      unsigned char wh_able;
 +      const unsigned char allow_neg = !!au_ftest_lkup(args->flags, ALLOW_NEG);
@@ -8097,9 +8035,11 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +
 +      wh_found = 0;
 +      br = au_sbr(dentry->d_sb, bindex);
++      h_userns = au_br_userns(br);
 +      wh_able = !!au_br_whable(br->br_perm);
 +      if (wh_able)
-+              wh_found = au_wh_test(h_parent, &args->whname, ignore_perm);
++              wh_found = au_wh_test(h_userns, h_parent, &args->whname,
++                                    ignore_perm);
 +      h_dentry = ERR_PTR(wh_found);
 +      if (!wh_found)
 +              goto real_lookup;
@@ -8116,7 +8056,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +      if (!ignore_perm)
 +              h_dentry = vfsub_lkup_one(args->name, h_parent);
 +      else
-+              h_dentry = au_sio_lkup_one(args->name, h_parent);
++              h_dentry = au_sio_lkup_one(h_userns, args->name, h_parent);
 +      if (IS_ERR(h_dentry)) {
 +              if (PTR_ERR(h_dentry) == -ENAMETOOLONG
 +                  && !allow_neg)
@@ -8151,7 +8091,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +              goto out; /* success */
 +
 +      inode_lock_shared_nested(h_inode, AuLsc_I_CHILD);
-+      opq = au_diropq_test(h_dentry);
++      opq = au_diropq_test(h_userns, h_dentry);
 +      inode_unlock_shared(h_inode);
 +      if (opq > 0)
 +              au_set_dbdiropq(dentry, bindex);
@@ -8296,12 +8236,13 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +      return err;
 +}
 +
-+struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent)
++struct dentry *au_sio_lkup_one(struct user_namespace *userns, struct qstr *name,
++                             struct dentry *parent)
 +{
 +      struct dentry *dentry;
 +      int wkq_err;
 +
-+      if (!au_test_h_perm_sio(d_inode(parent), MAY_EXEC))
++      if (!au_test_h_perm_sio(userns, d_inode(parent), MAY_EXEC))
 +              dentry = vfsub_lkup_one(name, parent);
 +      else {
 +              struct vfsub_lkup_one_args args = {
@@ -8326,14 +8267,16 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +      int err;
 +      struct dentry *parent, *h_parent, *h_dentry;
 +      struct au_branch *br;
++      struct user_namespace *h_userns;
 +
 +      parent = dget_parent(dentry);
 +      h_parent = au_h_dptr(parent, bindex);
 +      br = au_sbr(dentry->d_sb, bindex);
++      h_userns = au_br_userns(br);
 +      if (wh)
 +              h_dentry = au_whtmp_lkup(h_parent, br, &dentry->d_name);
 +      else
-+              h_dentry = au_sio_lkup_one(&dentry->d_name, h_parent);
++              h_dentry = au_sio_lkup_one(h_userns, &dentry->d_name, h_parent);
 +      err = PTR_ERR(h_dentry);
 +      if (IS_ERR(h_dentry))
 +              goto out;
@@ -9208,8 +9151,8 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +};
 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     2020-01-27 10:57:18.168871450 +0100
-@@ -0,0 +1,268 @@
++++ linux/fs/aufs/dentry.h     2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,269 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -9285,7 +9228,8 @@ diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
 +/* dentry.c */
 +extern const struct dentry_operations aufs_dop, aufs_dop_noreval;
 +struct au_branch;
-+struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent);
++struct dentry *au_sio_lkup_one(struct user_namespace *userns, struct qstr *name,
++                             struct dentry *parent);
 +int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir,
 +              struct dentry *h_parent, struct au_branch *br);
 +
@@ -9480,7 +9424,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
 +#endif /* __AUFS_DENTRY_H__ */
 diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
 --- /usr/share/empty/fs/aufs/dinfo.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dinfo.c      2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dinfo.c      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,554 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -10038,8 +9982,8 @@ diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
 +}
 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        2020-01-27 10:57:18.168871450 +0100
-@@ -0,0 +1,763 @@
++++ linux/fs/aufs/dir.c        2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,765 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -10679,12 +10623,14 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +      int err, wkq_err;
 +      struct dentry *h_dentry;
 +      struct inode *h_inode;
++      struct user_namespace *h_userns;
 +
++      h_userns = au_sbr_userns(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_inode, MAY_EXEC | MAY_READ);
++      err = au_test_h_perm_sio(h_userns, h_inode, MAY_EXEC | MAY_READ);
 +      inode_unlock_shared(h_inode);
 +      if (!err)
 +              err = do_test_empty(dentry, arg);
@@ -10805,7 +10751,7 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +};
 diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
 --- /usr/share/empty/fs/aufs/dir.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.h        2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dir.h        2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,134 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -10847,7 +10793,7 @@ diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
 +
 +struct au_vdir_destr {
 +      unsigned char   len;
-+      unsigned char   name[0];
++      unsigned char   name[];
 +} __packed;
 +
 +struct au_vdir_dehstr {
@@ -10943,7 +10889,7 @@ diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
 +#endif /* __AUFS_DIR_H__ */
 diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 --- /usr/share/empty/fs/aufs/dirren.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dirren.c     2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dirren.c     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,1316 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -11214,6 +11160,7 @@ diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 +      err = PTR_ERR(hinopath.dentry);
 +      if (IS_ERR(hinopath.dentry))
 +              goto out_unlock;
++      hinopath.mnt = path->mnt;
 +
 +      err = 0;
 +      flags = O_RDONLY;
@@ -11244,7 +11191,6 @@ diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 +              }
 +              flags = O_WRONLY;
 +      }
-+      hinopath.mnt = path->mnt;
 +      hinofile = vfsub_dentry_open(&hinopath, flags);
 +      if (suspend)
 +              au_hn_inode_unlock(hdir);
@@ -11531,7 +11477,7 @@ diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 +struct au_drinfo_rev {
 +      unsigned char                   already;
 +      aufs_bindex_t                   nelm;
-+      struct au_drinfo_rev_elm        elm[0];
++      struct au_drinfo_rev_elm        elm[];
 +};
 +
 +/* todo: isn't it too large? */
@@ -12263,7 +12209,7 @@ diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dirren.h linux/fs/aufs/dirren.h
 --- /usr/share/empty/fs/aufs/dirren.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dirren.h     2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dirren.h     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,140 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -12407,8 +12353,8 @@ diff -urN /usr/share/empty/fs/aufs/dirren.h linux/fs/aufs/dirren.h
 +#endif /* __AUFS_DIRREN_H__ */
 diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 --- /usr/share/empty/fs/aufs/dynop.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.c      2020-01-27 10:57:18.168871450 +0100
-@@ -0,0 +1,367 @@
++++ linux/fs/aufs/dynop.c      2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,368 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2010-2020 Junjiro R. Okajima
@@ -12591,6 +12537,7 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 +      DySetAop(writepages);
 +      DySetAop(set_page_dirty);
 +      DySetAop(readpages);
++      DySetAop(readahead);
 +      DySetAop(write_begin);
 +      DySetAop(write_end);
 +      DySetAop(bmap);
@@ -12778,7 +12725,7 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dynop.h linux/fs/aufs/dynop.h
 --- /usr/share/empty/fs/aufs/dynop.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.h      2020-01-27 10:57:18.168871450 +0100
++++ linux/fs/aufs/dynop.h      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,77 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -12859,8 +12806,8 @@ diff -urN /usr/share/empty/fs/aufs/dynop.h linux/fs/aufs/dynop.h
 +#endif /* __AUFS_DYNOP_H__ */
 diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 --- /usr/share/empty/fs/aufs/export.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/export.c     2020-01-27 10:57:18.168871450 +0100
-@@ -0,0 +1,838 @@
++++ linux/fs/aufs/export.c     2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,837 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -12984,8 +12931,7 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +      pos = inode->i_ino;
 +      pos *= sizeof(igen);
 +      igen = inode->i_generation + 1;
-+      sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xigen, &igen,
-+                       sizeof(igen), &pos);
++      sz = xino_fwrite(sbinfo->si_xigen, &igen, sizeof(igen), &pos);
 +      if (sz == sizeof(igen))
 +              return; /* success */
 +
@@ -13027,10 +12973,10 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +      if (vfsub_f_size_read(file)
 +          < pos + sizeof(inode->i_generation)) {
 +              inode->i_generation = atomic_inc_return(&sbinfo->si_xigen_next);
-+              sz = xino_fwrite(sbinfo->si_xwrite, file, &inode->i_generation,
++              sz = xino_fwrite(file, &inode->i_generation,
 +                               sizeof(inode->i_generation), &pos);
 +      } else
-+              sz = xino_fread(sbinfo->si_xread, file, &inode->i_generation,
++              sz = xino_fread(file, &inode->i_generation,
 +                              sizeof(inode->i_generation), &pos);
 +      if (sz == sizeof(inode->i_generation))
 +              goto out; /* success */
@@ -13701,7 +13647,7 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +}
 diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 --- /usr/share/empty/fs/aufs/fhsm.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/fhsm.c       2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/fhsm.c       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,427 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -14132,7 +14078,7 @@ diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 +}
 diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 --- /usr/share/empty/fs/aufs/file.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/file.c       2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/file.c       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,863 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -14999,7 +14945,7 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +};
 diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 --- /usr/share/empty/fs/aufs/file.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/file.h       2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/file.h       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,342 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -15345,7 +15291,7 @@ diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 +#endif /* __AUFS_FILE_H__ */
 diff -urN /usr/share/empty/fs/aufs/finfo.c linux/fs/aufs/finfo.c
 --- /usr/share/empty/fs/aufs/finfo.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/finfo.c      2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/finfo.c      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,149 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -15498,8 +15444,8 @@ diff -urN /usr/share/empty/fs/aufs/finfo.c linux/fs/aufs/finfo.c
 +}
 diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 --- /usr/share/empty/fs/aufs/f_op.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/f_op.c       2020-01-27 10:57:18.172204883 +0100
-@@ -0,0 +1,819 @@
++++ linux/fs/aufs/f_op.c       2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,771 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -15744,34 +15690,6 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +      fput(h_file);
 +}
 +
-+static ssize_t aufs_read(struct file *file, char __user *buf, size_t count,
-+                       loff_t *ppos)
-+{
-+      ssize_t err;
-+      struct inode *inode;
-+      struct file *h_file;
-+      struct super_block *sb;
-+
-+      inode = file_inode(file);
-+      sb = inode->i_sb;
-+      si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
-+
-+      h_file = au_read_pre(file, /*keep_fi*/0, /*lsc*/0);
-+      err = PTR_ERR(h_file);
-+      if (IS_ERR(h_file))
-+              goto out;
-+
-+      /* filedata may be obsoleted by concurrent copyup, but no problem */
-+      err = vfsub_read_u(h_file, buf, count, ppos);
-+      /* todo: necessary? */
-+      /* file->f_ra = h_file->f_ra; */
-+      au_read_post(inode, h_file);
-+
-+out:
-+      si_read_unlock(sb);
-+      return err;
-+}
-+
 +/*
 + * todo: very ugly
 + * it locks both of i_mutex and si_rwsem for read in safe.
@@ -15794,33 +15712,6 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +      }
 +}
 +
-+static ssize_t aufs_write(struct file *file, const char __user *ubuf,
-+                        size_t count, loff_t *ppos)
-+{
-+      ssize_t err;
-+      struct au_write_pre wpre;
-+      struct inode *inode;
-+      struct file *h_file;
-+      char __user *buf = (char __user *)ubuf;
-+
-+      inode = file_inode(file);
-+      au_mtx_and_read_lock(inode);
-+
-+      wpre.lsc = 0;
-+      h_file = au_write_pre(file, /*do_ready*/1, &wpre);
-+      err = PTR_ERR(h_file);
-+      if (IS_ERR(h_file))
-+              goto out;
-+
-+      err = vfsub_write_u(h_file, buf, count, ppos);
-+      au_write_post(inode, h_file, &wpre, err);
-+
-+out:
-+      si_read_unlock(inode->i_sb);
-+      inode_unlock(inode);
-+      return err;
-+}
-+
 +static ssize_t au_do_iter(struct file *h_file, int rw, struct kiocb *kio,
 +                        struct iov_iter *iov_iter)
 +{
@@ -15916,6 +15807,15 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +      return err;
 +}
 +
++/*
++ * We may be able to remove aufs_splice_{read,write}() since almost all FSes
++ * don't have their own .splice_{read,write} implimentations, and they use
++ * generic_file_splice_read() and iter_file_splice_write() who can act like the
++ * simple converters to f_op->iter_read() and ->iter_write().
++ * But we keep our own implementations because some non-mainlined FSes may have
++ * their own .splice_{read,write} implimentations and aufs doesn't want to take
++ * away an opportunity to co-work with aufs from them.
++ */
 +static ssize_t aufs_splice_read(struct file *file, loff_t *ppos,
 +                              struct pipe_inode_info *pipe, size_t len,
 +                              unsigned int flags)
@@ -16290,8 +16190,6 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +
 +      .llseek         = default_llseek,
 +
-+      .read           = aufs_read,
-+      .write          = aufs_write,
 +      .read_iter      = aufs_read_iter,
 +      .write_iter     = aufs_write_iter,
 +
@@ -16321,7 +16219,7 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +};
 diff -urN /usr/share/empty/fs/aufs/fstype.h linux/fs/aufs/fstype.h
 --- /usr/share/empty/fs/aufs/fstype.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/fstype.h     2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/fstype.h     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,401 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -16726,7 +16624,7 @@ diff -urN /usr/share/empty/fs/aufs/fstype.h linux/fs/aufs/fstype.h
 +#endif /* __AUFS_FSTYPE_H__ */
 diff -urN /usr/share/empty/fs/aufs/hbl.h linux/fs/aufs/hbl.h
 --- /usr/share/empty/fs/aufs/hbl.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hbl.h        2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/hbl.h        2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,65 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -16795,7 +16693,7 @@ diff -urN /usr/share/empty/fs/aufs/hbl.h linux/fs/aufs/hbl.h
 +#endif /* __AUFS_HBL_H__ */
 diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 --- /usr/share/empty/fs/aufs/hfsnotify.c       1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsnotify.c  2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/hfsnotify.c  2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,288 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -16959,8 +16857,8 @@ diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 +}
 +
 +static int au_hfsn_handle_event(struct fsnotify_group *group,
-+                              struct inode *inode,
 +                              u32 mask, const void *data, int data_type,
++                              struct inode *dir,
 +                              const struct qstr *file_name, u32 cookie,
 +                              struct fsnotify_iter_info *iter_info)
 +{
@@ -16977,7 +16875,7 @@ diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 +      if (mask & (FS_IN_IGNORED | FS_UNMOUNT))
 +              goto out;
 +
-+      h_dir = inode;
++      h_dir = dir;
 +      h_inode = NULL;
 +#ifdef AuDbgHnotify
 +      au_debug_on();
@@ -17087,7 +16985,7 @@ diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 +};
 diff -urN /usr/share/empty/fs/aufs/hfsplus.c linux/fs/aufs/hfsplus.c
 --- /usr/share/empty/fs/aufs/hfsplus.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsplus.c    2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/hfsplus.c    2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,60 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -17151,7 +17049,7 @@ diff -urN /usr/share/empty/fs/aufs/hfsplus.c linux/fs/aufs/hfsplus.c
 +}
 diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
 --- /usr/share/empty/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hnotify.c    2020-01-27 10:57:18.172204883 +0100
++++ linux/fs/aufs/hnotify.c    2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,715 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -17739,7 +17637,7 @@ diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
 +      case FS_MOVED_TO:
 +              au_fset_hnjob(flags[AuHn_CHILD], XINO0);
 +              au_fset_hnjob(flags[AuHn_CHILD], MNTPNT);
-+              /*FALLTHROUGH*/
++              fallthrough;
 +      case FS_CREATE:
 +              AuDebugOn(!h_child_name);
 +              break;
@@ -17870,7 +17768,7 @@ diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
 +}
 diff -urN /usr/share/empty/fs/aufs/iinfo.c linux/fs/aufs/iinfo.c
 --- /usr/share/empty/fs/aufs/iinfo.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/iinfo.c      2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/iinfo.c      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,286 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -18160,8 +18058,8 @@ diff -urN /usr/share/empty/fs/aufs/iinfo.c linux/fs/aufs/iinfo.c
 +}
 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      2020-01-27 10:57:18.175538316 +0100
-@@ -0,0 +1,529 @@
++++ linux/fs/aufs/inode.c      2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,531 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -18676,25 +18574,27 @@ diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
 +      return err;
 +}
 +
-+int au_test_h_perm(struct inode *h_inode, int mask)
++int au_test_h_perm(struct user_namespace *h_userns, struct inode *h_inode,
++                 int mask)
 +{
 +      if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID))
 +              return 0;
-+      return inode_permission(h_inode, mask);
++      return inode_permission(h_userns, h_inode, mask);
 +}
 +
-+int au_test_h_perm_sio(struct inode *h_inode, int mask)
++int au_test_h_perm_sio(struct user_namespace *h_userns, 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_inode, mask);
++      return au_test_h_perm(h_userns, 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      2020-01-27 10:57:18.175538316 +0100
-@@ -0,0 +1,698 @@
++++ linux/fs/aufs/inode.h      2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,705 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -18834,8 +18734,10 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +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 inode *h_inode, int mask);
-+int au_test_h_perm_sio(struct inode *h_inode, int mask);
++int au_test_h_perm(struct user_namespace *h_userns, struct inode *h_inode,
++                 int mask);
++int au_test_h_perm_sio(struct user_namespace *h_userns, struct inode *h_inode,
++                     int mask);
 +
 +static inline int au_wh_ino(struct super_block *sb, aufs_bindex_t bindex,
 +                          ino_t h_ino, unsigned int d_type, ino_t *ino)
@@ -18904,24 +18806,27 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia,
 +                   struct au_icpup_args *a);
 +
-+int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
-+                    int locked);
++int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
++                    struct path *h_path, int locked);
 +
 +/* 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 inode *dir, struct dentry *dentry, umode_t mode,
-+             dev_t dev);
-+int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
-+int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
-+              bool want_excl);
++int aufs_mknod(struct user_namespace *userns, struct inode *dir,
++             struct dentry *dentry, umode_t mode, dev_t dev);
++int aufs_symlink(struct user_namespace *userns, struct inode *dir,
++               struct dentry *dentry, const char *symname);
++int aufs_create(struct user_namespace *userns, 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 inode *dir, struct dentry *dentry, umode_t mode);
++int aufs_tmpfile(struct user_namespace *userns, struct inode *dir,
++               struct dentry *dentry, umode_t mode);
 +int aufs_link(struct dentry *src_dentry, struct inode *dir,
 +            struct dentry *dentry);
-+int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
++int aufs_mkdir(struct user_namespace *userns, struct inode *dir,
++             struct dentry *dentry, umode_t mode);
 +
 +/* i_op_del.c */
 +int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup);
@@ -18932,9 +18837,10 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +
 +/* i_op_ren.c */
 +int au_wbr(struct dentry *dentry, aufs_bindex_t btgt);
-+int aufs_rename(struct inode *src_dir, struct dentry *src_dentry,
-+              struct inode *dir, struct dentry *dentry,
-+              unsigned int flags);
++int aufs_rename(struct user_namespace *userns,
++              struct inode *_src_dir, struct dentry *_src_dentry,
++              struct inode *_dst_dir, struct dentry *_dst_dentry,
++              unsigned int _flags);
 +
 +/* iinfo.c */
 +struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex);
@@ -19004,19 +18910,20 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +
 +#ifdef CONFIG_AUFS_XATTR
 +/* xattr.c */
-+int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags,
++int au_cpup_xattr(struct path *h_dst, struct path *h_src, int ignore_flags,
 +                unsigned int verbose);
 +ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size);
 +void au_xattr_init(struct super_block *sb);
 +#else
-+AuStubInt0(au_cpup_xattr, struct dentry *h_dst, struct dentry *h_src,
++AuStubInt0(au_cpup_xattr, struct path *h_dst, struct path *h_src,
 +         int ignore_flags, unsigned int verbose);
 +AuStubVoid(au_xattr_init, struct super_block *sb);
 +#endif
 +
 +#ifdef CONFIG_FS_POSIX_ACL
 +struct posix_acl *aufs_get_acl(struct inode *inode, int type);
-+int aufs_set_acl(struct inode *inode, struct posix_acl *acl, int type);
++int aufs_set_acl(struct user_namespace *userns, struct inode *inode,
++               struct posix_acl *acl, int type);
 +#endif
 +
 +#if IS_ENABLED(CONFIG_AUFS_XATTR) || IS_ENABLED(CONFIG_FS_POSIX_ACL)
@@ -19290,7 +19197,7 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +      int (*alloc)(struct au_hinode *hinode);
 +
 +      /*
-+       * if it returns true, the the caller should free hinode->hi_notify,
++       * if it returns true, the caller should free hinode->hi_notify,
 +       * otherwise ->free() frees it.
 +       */
 +      int (*free)(struct au_hinode *hinode,
@@ -19395,7 +19302,7 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +#endif /* __AUFS_INODE_H__ */
 diff -urN /usr/share/empty/fs/aufs/ioctl.c linux/fs/aufs/ioctl.c
 --- /usr/share/empty/fs/aufs/ioctl.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/ioctl.c      2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/ioctl.c      2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,220 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -19619,8 +19526,8 @@ diff -urN /usr/share/empty/fs/aufs/ioctl.c linux/fs/aufs/ioctl.c
 +#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   2020-01-27 10:57:18.172204883 +0100
-@@ -0,0 +1,936 @@
++++ linux/fs/aufs/i_op_add.c   2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,941 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -19989,8 +19896,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      return err;
 +}
 +
-+int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
-+             dev_t dev)
++int aufs_mknod(struct user_namespace *userns, struct inode *dir,
++             struct dentry *dentry, umode_t mode, dev_t dev)
 +{
 +      struct simple_arg arg = {
 +              .type = Mknod,
@@ -20002,7 +19909,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      return add_simple(dir, dentry, &arg);
 +}
 +
-+int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
++int aufs_symlink(struct user_namespace *userns, struct inode *dir,
++               struct dentry *dentry, const char *symname)
 +{
 +      struct simple_arg arg = {
 +              .type = Symlink,
@@ -20011,8 +19919,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      return add_simple(dir, dentry, &arg);
 +}
 +
-+int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
-+              bool want_excl)
++int aufs_create(struct user_namespace *userns, struct inode *dir,
++              struct dentry *dentry, umode_t mode, bool want_excl)
 +{
 +      struct simple_arg arg = {
 +              .type = Creat,
@@ -20039,7 +19947,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      return add_simple(dir, dentry, &arg);
 +}
 +
-+int aufs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
++int aufs_tmpfile(struct user_namespace *userns, struct inode *dir,
++               struct dentry *dentry, umode_t mode)
 +{
 +      int err;
 +      aufs_bindex_t bindex;
@@ -20047,6 +19956,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      struct dentry *parent, *h_parent, *h_dentry;
 +      struct inode *h_dir, *inode;
 +      struct vfsmount *h_mnt;
++      struct user_namespace *h_userns;
 +      struct au_wr_dir_args wr_dir_args = {
 +              .force_btgt     = -1,
 +              .flags          = AuWrDir_TMPFILE
@@ -20093,8 +20003,9 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      if (unlikely(err))
 +              goto out_parent;
 +
++      h_userns = mnt_user_ns(h_mnt);
 +      h_parent = au_h_dptr(parent, bindex);
-+      h_dentry = vfs_tmpfile(h_parent, mode, /*open_flag*/0);
++      h_dentry = vfs_tmpfile(h_userns, h_parent, mode, /*open_flag*/0);
 +      if (IS_ERR(h_dentry)) {
 +              err = PTR_ERR(h_dentry);
 +              goto out_mnt;
@@ -20450,7 +20361,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +      return err;
 +}
 +
-+int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
++int aufs_mkdir(struct user_namespace *userns, struct inode *dir,
++             struct dentry *dentry, umode_t mode)
 +{
 +      int err, rerr;
 +      aufs_bindex_t bindex;
@@ -20559,8 +20471,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +}
 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       2020-01-27 10:57:18.172204883 +0100
-@@ -0,0 +1,1498 @@
++++ linux/fs/aufs/i_op.c       2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,1513 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -20595,6 +20507,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +{
 +      int err;
 +      const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND));
++      struct user_namespace *h_userns;
 +
 +      err = -EPERM;
 +      if (write_mask && IS_IMMUTABLE(h_inode))
@@ -20614,19 +20527,21 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +       * - 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);
 +      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))
 +          || !h_inode->i_op->permission) {
 +              /* AuLabel(generic_permission); */
 +              /* AuDbg("get_acl %ps\n", h_inode->i_op->get_acl); */
-+              err = generic_permission(h_inode, mask);
++              err = generic_permission(h_userns, h_inode, mask);
 +              if (err == -EOPNOTSUPP && au_test_nfs_noacl(h_inode))
-+                      err = h_inode->i_op->permission(h_inode, mask);
++                      err = h_inode->i_op->permission(h_userns, h_inode,
++                                                      mask);
 +              AuTraceErr(err);
 +      } else {
 +              /* AuLabel(h_inode->permission); */
-+              err = h_inode->i_op->permission(h_inode, mask);
++              err = h_inode->i_op->permission(h_userns, h_inode, mask);
 +              AuTraceErr(err);
 +      }
 +
@@ -20639,7 +20554,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      return err;
 +}
 +
-+static int aufs_permission(struct inode *inode, int mask)
++static int aufs_permission(struct user_namespace *userns, struct inode *inode,
++                         int mask)
 +{
 +      int err;
 +      aufs_bindex_t bindex, bbot;
@@ -21487,18 +21403,20 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      return err;
 +}
 +
-+static int aufs_setattr(struct dentry *dentry, struct iattr *ia)
++static int aufs_setattr(struct user_namespace *userns, struct dentry *dentry,
++                      struct iattr *ia)
 +{
 +      int err;
 +      struct inode *inode, *delegated;
 +      struct super_block *sb;
 +      struct file *file;
 +      struct au_icpup_args *a;
++      struct user_namespace *h_userns;
 +
 +      inode = d_inode(dentry);
 +      IMustLock(inode);
 +
-+      err = setattr_prepare(dentry, ia);
++      err = setattr_prepare(userns, dentry, ia);
 +      if (unlikely(err))
 +              goto out;
 +
@@ -21591,8 +21509,10 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +       * regardless aufs 'acl' option setting.
 +       * why don't all acl-aware fs call this func from their ->setattr()?
 +       */
-+      if (!err && (ia->ia_valid & ATTR_MODE))
-+              err = vfsub_acl_chmod(a->h_inode, ia->ia_mode);
++      if (!err && (ia->ia_valid & ATTR_MODE)) {
++              h_userns = mnt_user_ns(a->h_path.mnt);
++              err = vfsub_acl_chmod(h_userns, a->h_inode, ia->ia_mode);
++      }
 +      if (!err)
 +              au_cpup_attr_changeable(inode);
 +
@@ -21654,6 +21574,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      struct super_block *sb;
 +      struct au_icpup_args *a;
 +      struct inode *h_inode;
++      struct user_namespace *h_userns;
 +
 +      IMustLock(inode);
 +
@@ -21672,23 +21593,25 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      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);
 +
 +      inode_unlock(a->h_inode);
 +      switch (arg->type) {
 +      case AU_XATTR_SET:
 +              AuDebugOn(d_is_negative(h_path.dentry));
-+              err = vfsub_setxattr(h_path.dentry,
++              err = vfsub_setxattr(h_userns, h_path.dentry,
 +                                   arg->u.set.name, arg->u.set.value,
 +                                   arg->u.set.size, arg->u.set.flags);
 +              break;
 +      case AU_ACL_SET:
 +              err = -EOPNOTSUPP;
 +              h_inode = d_inode(h_path.dentry);
-+              if (h_inode->i_op->set_acl)
++              if (h_inode->i_op->set_acl) {
 +                      /* this will call posix_acl_update_mode */
-+                      err = h_inode->i_op->set_acl(h_inode,
++                      err = h_inode->i_op->set_acl(h_userns, h_inode,
 +                                                   arg->u.acl_set.acl,
 +                                                   arg->u.acl_set.type);
++              }
 +              break;
 +      }
 +      if (!err)
@@ -21743,15 +21666,14 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 + * returns zero or negative (an error).
 + * @dentry will be read-locked in success.
 + */
-+int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
-+                    int locked)
++int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
++                    struct path *h_path, int locked)
 +{
 +      int err;
 +      unsigned int mnt_flags, sigen;
 +      unsigned char udba_none;
 +      aufs_bindex_t bindex;
 +      struct super_block *sb, *h_sb;
-+      struct inode *inode;
 +
 +      h_path->mnt = NULL;
 +      h_path->dentry = NULL;
@@ -21792,7 +21714,11 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +              di_read_lock_child(dentry, AuLock_IR);
 +
 +body:
-+      inode = d_inode(dentry);
++      if (!inode) {
++              inode = d_inode(dentry);
++              if (unlikely(!inode))
++                      goto out;
++      }
 +      bindex = au_ibtop(inode);
 +      h_path->mnt = au_sbr_mnt(sb, bindex);
 +      h_sb = h_path->mnt->mnt_sb;
@@ -21816,8 +21742,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      return err;
 +}
 +
-+static int aufs_getattr(const struct path *path, struct kstat *st,
-+                      u32 request, unsigned int query)
++static int aufs_getattr(struct user_namespace *userns, const struct path *path,
++                      struct kstat *st, u32 request, unsigned int query)
 +{
 +      int err;
 +      unsigned char positive;
@@ -21832,7 +21758,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
 +      if (unlikely(err))
 +              goto out;
-+      err = au_h_path_getattr(dentry, /*force*/0, &h_path, /*locked*/0);
++      err = au_h_path_getattr(dentry, /*inode*/NULL, /*force*/0, &h_path,
++                              /*locked*/0);
 +      if (unlikely(err))
 +              goto out_si;
 +      if (unlikely(!h_path.dentry))
@@ -21853,7 +21780,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +      goto out_di;
 +
 +out_fill:
-+      generic_fillattr(inode, st);
++      generic_fillattr(userns, inode, st);
 +out_di:
 +      di_read_unlock(dentry, AuLock_IR);
 +out_si:
@@ -22061,8 +21988,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +};
 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   2020-01-27 10:57:18.172204883 +0100
-@@ -0,0 +1,513 @@
++++ linux/fs/aufs/i_op_del.c   2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,515 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -22159,6 +22086,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
 +      umode_t h_mode;
 +      struct dentry *h_dentry, *h_latest;
 +      struct inode *h_inode;
++      struct user_namespace *h_userns;
 +
 +      h_dentry = au_h_dptr(dentry, bindex);
 +      if (d_really_is_positive(dentry)) {
@@ -22196,12 +22124,13 @@ diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
 +       * let's try heavy test.
 +       */
 +      err = -EACCES;
++      h_userns = au_sbr_userns(dentry->d_sb, bindex);
 +      if (unlikely(!au_opt_test(au_mntflags(dentry->d_sb), DIRPERM1)
-+                   && au_test_h_perm(d_inode(h_parent),
++                   && au_test_h_perm(h_userns, d_inode(h_parent),
 +                                     MAY_EXEC | MAY_WRITE)))
 +              goto out;
 +
-+      h_latest = au_sio_lkup_one(&dentry->d_name, h_parent);
++      h_latest = au_sio_lkup_one(h_userns, &dentry->d_name, h_parent);
 +      err = -EIO;
 +      if (IS_ERR(h_latest))
 +              goto out;
@@ -22578,8 +22507,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
 +}
 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   2020-01-27 10:57:18.172204883 +0100
-@@ -0,0 +1,1250 @@
++++ linux/fs/aufs/i_op_ren.c   2021-05-02 20:15:14.673337458 +0200
+@@ -0,0 +1,1251 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -23535,7 +23464,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
 +
 +/* ---------------------------------------------------------------------- */
 +
-+int aufs_rename(struct inode *_src_dir, struct dentry *_src_dentry,
++int aufs_rename(struct user_namespace *userns,
++              struct inode *_src_dir, struct dentry *_src_dentry,
 +              struct inode *_dst_dir, struct dentry *_dst_dentry,
 +              unsigned int _flags)
 +{
@@ -23832,7 +23762,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
 +}
 diff -urN /usr/share/empty/fs/aufs/Kconfig linux/fs/aufs/Kconfig
 --- /usr/share/empty/fs/aufs/Kconfig   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/Kconfig      2019-07-11 15:42:14.458904362 +0200
++++ linux/fs/aufs/Kconfig      2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,199 @@
 +# SPDX-License-Identifier: GPL-2.0
 +config AUFS_FS
@@ -24035,7 +23965,7 @@ diff -urN /usr/share/empty/fs/aufs/Kconfig linux/fs/aufs/Kconfig
 +endif
 diff -urN /usr/share/empty/fs/aufs/lcnt.h linux/fs/aufs/lcnt.h
 --- /usr/share/empty/fs/aufs/lcnt.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/lcnt.h       2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/lcnt.h       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,186 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -24225,7 +24155,7 @@ diff -urN /usr/share/empty/fs/aufs/lcnt.h linux/fs/aufs/lcnt.h
 +#endif /* __AUFS_LCNT_H__ */
 diff -urN /usr/share/empty/fs/aufs/loop.c linux/fs/aufs/loop.c
 --- /usr/share/empty/fs/aufs/loop.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.c       2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/loop.c       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,148 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -24377,7 +24307,7 @@ diff -urN /usr/share/empty/fs/aufs/loop.c linux/fs/aufs/loop.c
 +}
 diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
 --- /usr/share/empty/fs/aufs/loop.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.h       2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/loop.h       2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,55 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -24436,7 +24366,7 @@ diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
 +#endif /* __AUFS_LOOP_H__ */
 diff -urN /usr/share/empty/fs/aufs/magic.mk linux/fs/aufs/magic.mk
 --- /usr/share/empty/fs/aufs/magic.mk  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/magic.mk     2019-07-11 15:42:14.468904634 +0200
++++ linux/fs/aufs/magic.mk     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,31 @@
 +# SPDX-License-Identifier: GPL-2.0
 +
@@ -24471,7 +24401,7 @@ diff -urN /usr/share/empty/fs/aufs/magic.mk linux/fs/aufs/magic.mk
 +endif
 diff -urN /usr/share/empty/fs/aufs/Makefile linux/fs/aufs/Makefile
 --- /usr/share/empty/fs/aufs/Makefile  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/Makefile     2019-07-11 15:42:14.462237786 +0200
++++ linux/fs/aufs/Makefile     2021-05-02 20:15:14.670004120 +0200
 @@ -0,0 +1,46 @@
 +# SPDX-License-Identifier: GPL-2.0
 +
@@ -24521,7 +24451,7 @@ diff -urN /usr/share/empty/fs/aufs/Makefile linux/fs/aufs/Makefile
 +aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o
 diff -urN /usr/share/empty/fs/aufs/module.c linux/fs/aufs/module.c
 --- /usr/share/empty/fs/aufs/module.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/module.c     2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/module.c     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,273 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -24798,7 +24728,7 @@ diff -urN /usr/share/empty/fs/aufs/module.c linux/fs/aufs/module.c
 +module_exit(aufs_exit);
 diff -urN /usr/share/empty/fs/aufs/module.h linux/fs/aufs/module.h
 --- /usr/share/empty/fs/aufs/module.h  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/module.h     2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/module.h     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,166 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -24968,7 +24898,7 @@ diff -urN /usr/share/empty/fs/aufs/module.h linux/fs/aufs/module.h
 +#endif /* __AUFS_MODULE_H__ */
 diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 --- /usr/share/empty/fs/aufs/mvdown.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/mvdown.c     2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/mvdown.c     2021-05-02 20:15:14.673337458 +0200
 @@ -0,0 +1,706 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -25678,7 +25608,7 @@ diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 +}
 diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 --- /usr/share/empty/fs/aufs/opts.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.c       2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/opts.c       2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,1880 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -26189,7 +26119,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +                      err = e;
 +                      break;
 +              }
-+              /*FALLTHROUGH*/
++              fallthrough;
 +      case AuWbrCreate_MFS:
 +      case AuWbrCreate_PMFS:
 +              create->mfs_second = AUFS_MFS_DEF_SEC;
@@ -26921,7 +26851,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +
 +              case Opt_ignore:
 +                      pr_warn("ignored %s\n", opt_str);
-+                      /*FALLTHROUGH*/
++                      fallthrough;
 +              case Opt_ignore_silent:
 +                      skipped = 1;
 +                      err = 0;
@@ -26977,7 +26907,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +      case AuWbrCreate_PMFSRR:
 +      case AuWbrCreate_PMFSRRV:
 +              sbinfo->si_wbr_mfs.mfsrr_watermark = create->mfsrr_watermark;
-+              /*FALLTHROUGH*/
++              fallthrough;
 +      case AuWbrCreate_MFS:
 +      case AuWbrCreate_MFSV:
 +      case AuWbrCreate_PMFS:
@@ -27197,7 +27127,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +              /* Always goto add, not fallthrough */
 +      case Opt_prepend:
 +              opt->add.bindex = 0;
-+              /* fallthrough */
++              fallthrough;
 +      add: /* indented label */
 +      case Opt_add:
 +              err = au_br_add(sb, &opt->add,
@@ -27562,7 +27492,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +}
 diff -urN /usr/share/empty/fs/aufs/opts.h linux/fs/aufs/opts.h
 --- /usr/share/empty/fs/aufs/opts.h    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.h       2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/opts.h       2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,225 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -27791,7 +27721,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.h linux/fs/aufs/opts.h
 +#endif /* __AUFS_OPTS_H__ */
 diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
 --- /usr/share/empty/fs/aufs/plink.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/plink.c      2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/plink.c      2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,516 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -28311,7 +28241,7 @@ diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
 +}
 diff -urN /usr/share/empty/fs/aufs/poll.c linux/fs/aufs/poll.c
 --- /usr/share/empty/fs/aufs/poll.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/poll.c       2020-01-27 10:57:18.175538316 +0100
++++ linux/fs/aufs/poll.c       2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,51 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -28366,8 +28296,8 @@ diff -urN /usr/share/empty/fs/aufs/poll.c linux/fs/aufs/poll.c
 +}
 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  2020-01-27 10:57:18.175538316 +0100
-@@ -0,0 +1,105 @@
++++ linux/fs/aufs/posix_acl.c  2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,106 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2014-2020 Junjiro R. Okajima
@@ -28433,7 +28363,8 @@ diff -urN /usr/share/empty/fs/aufs/posix_acl.c linux/fs/aufs/posix_acl.c
 +      return acl;
 +}
 +
-+int aufs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
++int aufs_set_acl(struct user_namespace *userns, struct inode *inode,
++               struct posix_acl *acl, int type)
 +{
 +      int err;
 +      ssize_t ssz;
@@ -28475,7 +28406,7 @@ diff -urN /usr/share/empty/fs/aufs/posix_acl.c linux/fs/aufs/posix_acl.c
 +}
 diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
 --- /usr/share/empty/fs/aufs/procfs.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/procfs.c     2020-03-30 09:50:57.598730603 +0200
++++ linux/fs/aufs/procfs.c     2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,170 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -28649,7 +28580,7 @@ diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/rdu.c linux/fs/aufs/rdu.c
 --- /usr/share/empty/fs/aufs/rdu.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/rdu.c        2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/rdu.c        2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,384 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -29037,8 +28968,8 @@ diff -urN /usr/share/empty/fs/aufs/rdu.c linux/fs/aufs/rdu.c
 +#endif
 diff -urN /usr/share/empty/fs/aufs/rwsem.h linux/fs/aufs/rwsem.h
 --- /usr/share/empty/fs/aufs/rwsem.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/rwsem.h      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,73 @@
++++ linux/fs/aufs/rwsem.h      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,85 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -29073,19 +29004,31 @@ diff -urN /usr/share/empty/fs/aufs/rwsem.h linux/fs/aufs/rwsem.h
 +
 +/* to debug easier, do not make them inlined functions */
 +#define AuRwMustNoWaiters(rw) AuDebugOn(rwsem_is_contended(rw))
++
++#ifdef CONFIG_LOCKDEP
 +/* rwsem_is_locked() is unusable */
-+#define AuRwMustReadLock(rw)  AuDebugOn(!lockdep_recursing(current) \
-+                                        && debug_locks \
++#define AuRwMustReadLock(rw)  AuDebugOn(IS_ENABLED(CONFIG_LOCKDEP)    \
++                                        && !lockdep_recursing(current) \
++                                        && debug_locks                \
 +                                        && !lockdep_is_held_type(rw, 1))
-+#define AuRwMustWriteLock(rw) AuDebugOn(!lockdep_recursing(current) \
-+                                        && debug_locks \
++#define AuRwMustWriteLock(rw) AuDebugOn(IS_ENABLED(CONFIG_LOCKDEP)    \
++                                        && !lockdep_recursing(current) \
++                                        && debug_locks                \
 +                                        && !lockdep_is_held_type(rw, 0))
-+#define AuRwMustAnyLock(rw)   AuDebugOn(!lockdep_recursing(current) \
-+                                        && debug_locks \
++#define AuRwMustAnyLock(rw)   AuDebugOn(IS_ENABLED(CONFIG_LOCKDEP)    \
++                                        && !lockdep_recursing(current) \
++                                        && debug_locks                \
 +                                        && !lockdep_is_held(rw))
-+#define AuRwDestroy(rw)               AuDebugOn(!lockdep_recursing(current) \
-+                                        && debug_locks \
++#define AuRwDestroy(rw)               AuDebugOn(IS_ENABLED(CONFIG_LOCKDEP)    \
++                                        && !lockdep_recursing(current) \
++                                        && debug_locks                \
 +                                        && lockdep_is_held(rw))
++#else
++#define AuRwMustReadLock(rw)  do {} while (0)
++#define AuRwMustWriteLock(rw) do {} while (0)
++#define AuRwMustAnyLock(rw)   do {} while (0)
++#define AuRwDestroy(rw)               do {} while (0)
++#endif
 +
 +#define au_rw_init(rw)        init_rwsem(rw)
 +
@@ -29114,7 +29057,7 @@ diff -urN /usr/share/empty/fs/aufs/rwsem.h linux/fs/aufs/rwsem.h
 +#endif /* __AUFS_RWSEM_H__ */
 diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 --- /usr/share/empty/fs/aufs/sbinfo.c  1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sbinfo.c     2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/sbinfo.c     2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,314 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -29432,8 +29375,8 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 +}
 diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 --- /usr/share/empty/fs/aufs/super.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/super.c      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,1047 @@
++++ linux/fs/aufs/super.c      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,1050 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -30475,7 +30418,10 @@ diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 +struct file_system_type aufs_fs_type = {
 +      .name           = AUFS_FSTYPE,
 +      /* a race between rename and others */
-+      .fs_flags       = FS_RENAME_DOES_D_MOVE,
++      .fs_flags       = FS_RENAME_DOES_D_MOVE
++                              /* untested */
++                              /*| FS_ALLOW_IDMAP*/
++                              ,
 +      .mount          = aufs_mount,
 +      .kill_sb        = aufs_kill_sb,
 +      /* no need to __module_get() and module_put(). */
@@ -30483,8 +30429,8 @@ diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 +};
 diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 --- /usr/share/empty/fs/aufs/super.h   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/super.h      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,589 @@
++++ linux/fs/aufs/super.h      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,587 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -30618,8 +30564,6 @@ diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 +      unsigned int            si_mntflags;
 +
 +      /* external inode number (bitmap and translation table) */
-+      vfs_readf_t             si_xread;
-+      vfs_writef_t            si_xwrite;
 +      loff_t                  si_ximaxent;    /* max entries in a xino */
 +
 +      struct file             *si_xib;
@@ -31076,7 +31020,7 @@ diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 +#endif /* __AUFS_SUPER_H__ */
 diff -urN /usr/share/empty/fs/aufs/sysaufs.c linux/fs/aufs/sysaufs.c
 --- /usr/share/empty/fs/aufs/sysaufs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysaufs.c    2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/sysaufs.c    2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,93 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -31173,7 +31117,7 @@ diff -urN /usr/share/empty/fs/aufs/sysaufs.c linux/fs/aufs/sysaufs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/sysaufs.h linux/fs/aufs/sysaufs.h
 --- /usr/share/empty/fs/aufs/sysaufs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysaufs.h    2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/sysaufs.h    2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,102 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -31279,7 +31223,7 @@ diff -urN /usr/share/empty/fs/aufs/sysaufs.h linux/fs/aufs/sysaufs.h
 +#endif /* __SYSAUFS_H__ */
 diff -urN /usr/share/empty/fs/aufs/sysfs.c linux/fs/aufs/sysfs.c
 --- /usr/share/empty/fs/aufs/sysfs.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysfs.c      2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/sysfs.c      2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,374 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -31657,7 +31601,7 @@ diff -urN /usr/share/empty/fs/aufs/sysfs.c linux/fs/aufs/sysfs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/sysrq.c linux/fs/aufs/sysrq.c
 --- /usr/share/empty/fs/aufs/sysrq.c   1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysrq.c      2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/sysrq.c      2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,149 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -31810,7 +31754,7 @@ diff -urN /usr/share/empty/fs/aufs/sysrq.c linux/fs/aufs/sysrq.c
 +}
 diff -urN /usr/share/empty/fs/aufs/vdir.c linux/fs/aufs/vdir.c
 --- /usr/share/empty/fs/aufs/vdir.c    1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vdir.c       2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/vdir.c       2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,896 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -32710,8 +32654,8 @@ diff -urN /usr/share/empty/fs/aufs/vdir.c linux/fs/aufs/vdir.c
 +}
 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      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,902 @@
++++ linux/fs/aufs/vfsub.c      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,916 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -32790,15 +32734,8 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +
 +struct file *vfsub_dentry_open(struct path *path, int flags)
 +{
-+      struct file *file;
-+
-+      file = dentry_open(path, flags /* | __FMODE_NONOTIFY */,
++      return dentry_open(path, flags /* | __FMODE_NONOTIFY */,
 +                         current_cred());
-+      if (!IS_ERR_OR_NULL(file)
-+          && (file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
-+              i_readcount_inc(d_inode(path->dentry));
-+
-+      return file;
 +}
 +
 +struct file *vfsub_filp_open(const char *path, int oflags, int mode)
@@ -32965,6 +32902,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      int err;
 +      struct dentry *d;
++      struct user_namespace *userns;
 +
 +      IMustLock(dir);
 +
@@ -32974,9 +32912,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      path->dentry = d;
 +      if (unlikely(err))
 +              goto out;
++      userns = mnt_user_ns(path->mnt);
 +
 +      lockdep_off();
-+      err = vfs_create(dir, path->dentry, mode, want_excl);
++      err = vfs_create(userns, dir, path->dentry, mode, want_excl);
 +      lockdep_on();
 +      if (!err) {
 +              struct path tmp = *path;
@@ -32998,6 +32937,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      int err;
 +      struct dentry *d;
++      struct user_namespace *userns;
 +
 +      IMustLock(dir);
 +
@@ -33007,9 +32947,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      path->dentry = d;
 +      if (unlikely(err))
 +              goto out;
++      userns = mnt_user_ns(path->mnt);
 +
 +      lockdep_off();
-+      err = vfs_symlink(dir, path->dentry, symname);
++      err = vfs_symlink(userns, dir, path->dentry, symname);
 +      lockdep_on();
 +      if (!err) {
 +              struct path tmp = *path;
@@ -33031,6 +32972,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      int err;
 +      struct dentry *d;
++      struct user_namespace *userns;
 +
 +      IMustLock(dir);
 +
@@ -33040,9 +32982,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      path->dentry = d;
 +      if (unlikely(err))
 +              goto out;
++      userns = mnt_user_ns(path->mnt);
 +
 +      lockdep_off();
-+      err = vfs_mknod(dir, path->dentry, mode, dev);
++      err = vfs_mknod(userns, dir, path->dentry, mode, dev);
 +      lockdep_on();
 +      if (!err) {
 +              struct path tmp = *path;
@@ -33075,6 +33018,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      int err;
 +      struct dentry *d;
++      struct user_namespace *userns;
 +
 +      IMustLock(dir);
 +
@@ -33089,9 +33033,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      path->dentry = d;
 +      if (unlikely(err))
 +              goto out;
++      userns = mnt_user_ns(path->mnt);
 +
 +      lockdep_off();
-+      err = vfs_link(src_dentry, dir, path->dentry, delegated_inode);
++      err = vfs_link(src_dentry, userns, dir, path->dentry, delegated_inode);
 +      lockdep_on();
 +      if (!err) {
 +              struct path tmp = *path;
@@ -33117,6 +33062,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +               struct inode **delegated_inode, unsigned int flags)
 +{
 +      int err;
++      struct renamedata rd;
 +      struct path tmp = {
 +              .mnt    = path->mnt
 +      };
@@ -33133,9 +33079,16 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      if (unlikely(err))
 +              goto out;
 +
++      rd.old_mnt_userns = mnt_user_ns(path->mnt);
++      rd.old_dir = src_dir;
++      rd.old_dentry = src_dentry;
++      rd.new_mnt_userns = rd.old_mnt_userns;
++      rd.new_dir = dir;
++      rd.new_dentry = path->dentry;
++      rd.delegated_inode = delegated_inode;
++      rd.flags = flags;
 +      lockdep_off();
-+      err = vfs_rename(src_dir, src_dentry, dir, path->dentry,
-+                       delegated_inode, flags);
++      err = vfs_rename(&rd);
 +      lockdep_on();
 +      if (!err) {
 +              int did;
@@ -33159,6 +33112,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      int err;
 +      struct dentry *d;
++      struct user_namespace *userns;
 +
 +      IMustLock(dir);
 +
@@ -33168,9 +33122,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      path->dentry = d;
 +      if (unlikely(err))
 +              goto out;
++      userns = mnt_user_ns(path->mnt);
 +
 +      lockdep_off();
-+      err = vfs_mkdir(dir, path->dentry, mode);
++      err = vfs_mkdir(userns, dir, path->dentry, mode);
 +      lockdep_on();
 +      if (!err) {
 +              struct path tmp = *path;
@@ -33192,6 +33147,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      int err;
 +      struct dentry *d;
++      struct user_namespace *userns;
 +
 +      IMustLock(dir);
 +
@@ -33201,9 +33157,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      path->dentry = d;
 +      if (unlikely(err))
 +              goto out;
++      userns = mnt_user_ns(path->mnt);
 +
 +      lockdep_off();
-+      err = vfs_rmdir(dir, path->dentry);
++      err = vfs_rmdir(userns, dir, path->dentry);
 +      lockdep_on();
 +      if (!err) {
 +              struct path tmp = {
@@ -33234,22 +33191,17 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      return err;
 +}
 +
-+/* todo: kernel_read()? */
 +ssize_t vfsub_read_k(struct file *file, void *kbuf, size_t count,
 +                   loff_t *ppos)
 +{
 +      ssize_t err;
-+      mm_segment_t oldfs;
-+      union {
-+              void *k;
-+              char __user *u;
-+      } buf;
 +
-+      buf.k = kbuf;
-+      oldfs = get_fs();
-+      set_fs(KERNEL_DS);
-+      err = vfsub_read_u(file, buf.u, count, ppos);
-+      set_fs(oldfs);
++      lockdep_off();
++      err = kernel_read(file, kbuf, count, ppos);
++      lockdep_on();
++      AuTraceErr(err);
++      if (err >= 0)
++              vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/
 +      return err;
 +}
 +
@@ -33269,17 +33221,12 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +ssize_t vfsub_write_k(struct file *file, void *kbuf, size_t count, loff_t *ppos)
 +{
 +      ssize_t err;
-+      mm_segment_t oldfs;
-+      union {
-+              void *k;
-+              const char __user *u;
-+      } buf;
 +
-+      buf.k = kbuf;
-+      oldfs = get_fs();
-+      set_fs(KERNEL_DS);
-+      err = vfsub_write_u(file, buf.u, count, ppos);
-+      set_fs(oldfs);
++      lockdep_off();
++      err = kernel_write(file, kbuf, count, ppos);
++      lockdep_on();
++      if (err >= 0)
++              vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/
 +      return err;
 +}
 +
@@ -33371,6 +33318,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      int err;
 +      struct inode *h_inode;
 +      struct super_block *h_sb;
++      struct user_namespace *h_userns;
 +
 +      if (!h_file) {
 +              err = vfsub_truncate(h_path, length);
@@ -33386,8 +33334,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      if (!err)
 +              err = security_path_truncate(h_path);
 +      if (!err) {
++              h_userns = mnt_user_ns(h_path->mnt);
 +              lockdep_off();
-+              err = do_truncate(h_path->dentry, length, attr, h_file);
++              err = do_truncate(h_userns, h_path->dentry, length, attr,
++                                h_file);
 +              lockdep_on();
 +      }
 +      lockdep_off();
@@ -33416,8 +33366,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +int vfsub_sio_mkdir(struct inode *dir, struct path *path, int mode)
 +{
 +      int err, do_sio, wkq_err;
++      struct user_namespace *userns;
 +
-+      do_sio = au_test_h_perm_sio(dir, MAY_EXEC | MAY_WRITE);
++      userns = mnt_user_ns(path->mnt);
++      do_sio = au_test_h_perm_sio(userns, dir, MAY_EXEC | MAY_WRITE);
 +      if (!do_sio) {
 +              lockdep_off();
 +              err = vfsub_mkdir(dir, path, mode);
@@ -33452,8 +33404,10 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +int vfsub_sio_rmdir(struct inode *dir, struct path *path)
 +{
 +      int err, do_sio, wkq_err;
++      struct user_namespace *userns;
 +
-+      do_sio = au_test_h_perm_sio(dir, MAY_EXEC | MAY_WRITE);
++      userns = mnt_user_ns(path->mnt);
++      do_sio = au_test_h_perm_sio(userns, dir, MAY_EXEC | MAY_WRITE);
 +      if (!do_sio) {
 +              lockdep_off();
 +              err = vfsub_rmdir(dir, path);
@@ -33485,14 +33439,16 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +{
 +      struct notify_change_args *a = args;
 +      struct inode *h_inode;
++      struct user_namespace *userns;
 +
 +      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);
 +              lockdep_off();
-+              *a->errp = notify_change(a->path->dentry, a->ia,
++              *a->errp = notify_change(userns, a->path->dentry, a->ia,
 +                                       a->delegated_inode);
 +              lockdep_on();
 +              if (!*a->errp)
@@ -33549,6 +33505,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +      struct unlink_args *a = args;
 +      struct dentry *d = a->path->dentry;
 +      struct inode *h_inode;
++      struct user_namespace *userns;
 +      const int stop_sillyrename = (au_test_nfs(d->d_sb)
 +                                    && au_dcount(d) == 1);
 +
@@ -33568,8 +33525,9 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +              ihold(h_inode);
 +      }
 +
++      userns = mnt_user_ns(a->path->mnt);
 +      lockdep_off();
-+      *a->errp = vfs_unlink(a->dir, d, a->delegated_inode);
++      *a->errp = vfs_unlink(userns, a->dir, d, a->delegated_inode);
 +      lockdep_on();
 +      if (!*a->errp) {
 +              struct path tmp = {
@@ -33616,8 +33574,8 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +}
 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      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,354 @@
++++ linux/fs/aufs/vfsub.h      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,358 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -33854,17 +33812,19 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
 +}
 +
 +#ifdef CONFIG_FS_POSIX_ACL
-+static inline int vfsub_acl_chmod(struct inode *h_inode, umode_t h_mode)
++static inline int vfsub_acl_chmod(struct user_namespace *h_userns,
++                                struct inode *h_inode, umode_t h_mode)
 +{
 +      int err;
 +
-+      err = posix_acl_chmod(h_inode, h_mode);
++      err = posix_acl_chmod(h_userns, h_inode, h_mode);
 +      if (err == -EOPNOTSUPP)
 +              err = 0;
 +      return err;
 +}
 +#else
-+AuStubInt0(vfsub_acl_chmod, struct inode *h_inode, umode_t h_mode);
++AuStubInt0(vfsub_acl_chmod, struct user_namespace *h_userns,
++         struct inode *h_inode, umode_t h_mode);
 +#endif
 +
 +long vfsub_splice_to(struct file *in, loff_t *ppos,
@@ -33947,24 +33907,26 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
 +
 +/* ---------------------------------------------------------------------- */
 +
-+static inline int vfsub_setxattr(struct dentry *dentry, const char *name,
++static inline int vfsub_setxattr(struct user_namespace *userns,
++                               struct dentry *dentry, const char *name,
 +                               const void *value, size_t size, int flags)
 +{
 +      int err;
 +
 +      lockdep_off();
-+      err = vfs_setxattr(dentry, name, value, size, flags);
++      err = vfs_setxattr(userns, dentry, name, value, size, flags);
 +      lockdep_on();
 +
 +      return err;
 +}
 +
-+static inline int vfsub_removexattr(struct dentry *dentry, const char *name)
++static inline int vfsub_removexattr(struct user_namespace *userns,
++                                  struct dentry *dentry, const char *name)
 +{
 +      int err;
 +
 +      lockdep_off();
-+      err = vfs_removexattr(dentry, name);
++      err = vfs_removexattr(userns, dentry, name);
 +      lockdep_on();
 +
 +      return err;
@@ -33974,7 +33936,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
 +#endif /* __AUFS_VFSUB_H__ */
 diff -urN /usr/share/empty/fs/aufs/wbr_policy.c linux/fs/aufs/wbr_policy.c
 --- /usr/share/empty/fs/aufs/wbr_policy.c      1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wbr_policy.c 2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/wbr_policy.c 2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,830 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -34808,8 +34770,8 @@ diff -urN /usr/share/empty/fs/aufs/wbr_policy.c linux/fs/aufs/wbr_policy.c
 +};
 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      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,1062 @@
++++ linux/fs/aufs/whout.c      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,1070 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -34876,7 +34838,8 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 + * test if the @wh_name exists under @h_parent.
 + * @try_sio specifies the necessary of super-io.
 + */
-+int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio)
++int au_wh_test(struct user_namespace *h_userns, struct dentry *h_parent,
++             struct qstr *wh_name, int try_sio)
 +{
 +      int err;
 +      struct dentry *wh_dentry;
@@ -34884,7 +34847,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +      if (!try_sio)
 +              wh_dentry = vfsub_lkup_one(wh_name, h_parent);
 +      else
-+              wh_dentry = au_sio_lkup_one(wh_name, h_parent);
++              wh_dentry = au_sio_lkup_one(h_userns, wh_name, h_parent);
 +      err = PTR_ERR(wh_dentry);
 +      if (IS_ERR(wh_dentry)) {
 +              if (err == -ENAMETOOLONG)
@@ -34913,14 +34876,14 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +/*
 + * test if the @h_dentry sets opaque or not.
 + */
-+int au_diropq_test(struct dentry *h_dentry)
++int au_diropq_test(struct user_namespace *h_userns, struct dentry *h_dentry)
 +{
 +      int err;
 +      struct inode *h_dir;
 +
 +      h_dir = d_inode(h_dentry);
-+      err = au_wh_test(h_dentry, &diropq_name,
-+                       au_test_h_perm_sio(h_dir, MAY_EXEC));
++      err = au_wh_test(h_userns, h_dentry, &diropq_name,
++                       au_test_h_perm_sio(h_userns, h_dir, MAY_EXEC));
 +      return err;
 +}
 +
@@ -34937,6 +34900,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +      /* strict atomic_t is unnecessary here */
 +      static unsigned short cnt;
 +      struct qstr qs;
++      struct user_namespace *h_userns;
 +
 +      BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN);
 +
@@ -34960,10 +34924,11 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +      *p++ = '.';
 +      AuDebugOn(name + qs.len + 1 - p <= AUFS_WH_TMP_LEN);
 +
++      h_userns = au_br_userns(br);
 +      qs.name = name;
 +      for (i = 0; i < 3; i++) {
 +              sprintf(p, "%.*x", AUFS_WH_TMP_LEN, cnt++);
-+              dentry = au_sio_lkup_one(&qs, h_parent);
++              dentry = au_sio_lkup_one(h_userns, &qs, h_parent);
 +              if (IS_ERR(dentry) || d_is_negative(dentry))
 +                      goto out_name;
 +              dput(dentry);
@@ -35562,9 +35527,12 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +                           unsigned int flags)
 +{
 +      struct dentry *diropq, *h_dentry;
++      struct user_namespace *h_userns;
 +
++      h_userns = au_sbr_userns(dentry->d_sb, bindex);
 +      h_dentry = au_h_dptr(dentry, bindex);
-+      if (!au_test_h_perm_sio(d_inode(h_dentry), MAY_EXEC | MAY_WRITE))
++      if (!au_test_h_perm_sio(h_userns, d_inode(h_dentry),
++                              MAY_EXEC | MAY_WRITE))
 +              diropq = do_diropq(dentry, bindex, flags);
 +      else {
 +              int wkq_err;
@@ -35750,11 +35718,13 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +      struct path h_tmp;
 +      struct inode *wh_inode, *h_dir;
 +      struct au_branch *br;
++      struct user_namespace *h_userns;
 +
 +      h_dir = d_inode(wh_dentry->d_parent); /* dir inode is locked */
 +      IMustLock(h_dir);
 +
 +      br = au_sbr(dir->i_sb, bindex);
++      h_userns = au_br_userns(br);
 +      wh_inode = d_inode(wh_dentry);
 +      inode_lock_nested(wh_inode, AuLsc_I_CHILD);
 +
@@ -35762,7 +35732,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +       * 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(wh_inode, MAY_EXEC | MAY_WRITE))
++      if (!au_test_h_perm_sio(h_userns, wh_inode, MAY_EXEC | MAY_WRITE))
 +              err = del_wh_children(wh_dentry, whlist, bindex, br);
 +      else {
 +              int wkq_err;
@@ -35874,8 +35844,8 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +}
 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      2020-01-27 10:57:18.178871751 +0100
-@@ -0,0 +1,86 @@
++++ linux/fs/aufs/whout.h      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,87 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -35907,8 +35877,9 @@ diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
 +
 +/* whout.c */
 +int au_wh_name_alloc(struct qstr *wh, const struct qstr *name);
-+int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio);
-+int au_diropq_test(struct dentry *h_dentry);
++int au_wh_test(struct user_namespace *h_userns, struct dentry *h_parent,
++             struct qstr *wh_name, int try_sio);
++int au_diropq_test(struct user_namespace *h_userns, struct dentry *h_dentry);
 +struct au_branch;
 +struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br,
 +                           struct qstr *prefix);
@@ -35964,7 +35935,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
 +#endif /* __AUFS_WHOUT_H__ */
 diff -urN /usr/share/empty/fs/aufs/wkq.c linux/fs/aufs/wkq.c
 --- /usr/share/empty/fs/aufs/wkq.c     1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wkq.c        2020-01-27 10:57:18.178871751 +0100
++++ linux/fs/aufs/wkq.c        2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,372 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -36340,7 +36311,7 @@ diff -urN /usr/share/empty/fs/aufs/wkq.c linux/fs/aufs/wkq.c
 +}
 diff -urN /usr/share/empty/fs/aufs/wkq.h linux/fs/aufs/wkq.h
 --- /usr/share/empty/fs/aufs/wkq.h     1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wkq.h        2020-01-27 10:57:18.182205184 +0100
++++ linux/fs/aufs/wkq.h        2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,89 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -36433,8 +36404,8 @@ diff -urN /usr/share/empty/fs/aufs/wkq.h linux/fs/aufs/wkq.h
 +#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      2020-01-27 10:57:18.182205184 +0100
-@@ -0,0 +1,356 @@
++++ linux/fs/aufs/xattr.c      2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,368 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2014-2020 Junjiro R. Okajima
@@ -36501,21 +36472,26 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +
 +static const int au_xattr_out_of_list = AuBrAttr_ICEX_OTH << 1;
 +
-+static int au_do_cpup_xattr(struct dentry *h_dst, struct dentry *h_src,
++static int au_do_cpup_xattr(struct path *h_dst, struct path *h_src,
 +                          char *name, char **buf, unsigned int ignore_flags,
 +                          unsigned int verbose)
 +{
 +      int err;
 +      ssize_t ssz;
 +      struct inode *h_idst;
++      struct dentry *h_dst_dentry, *h_src_dentry;
++      struct user_namespace *h_dst_userns, *h_src_userns;
 +
-+      ssz = vfs_getxattr_alloc(h_src, name, buf, 0, GFP_NOFS);
++      h_src_userns = mnt_user_ns(h_src->mnt);
++      h_src_dentry = h_src->dentry;
++      ssz = vfs_getxattr_alloc(h_src_userns, h_src_dentry, name, buf, 0,
++                               GFP_NOFS);
 +      err = ssz;
 +      if (unlikely(err <= 0)) {
 +              if (err == -ENODATA
 +                  || (err == -EOPNOTSUPP
 +                      && ((ignore_flags & au_xattr_out_of_list)
-+                          || (au_test_nfs_noacl(d_inode(h_src))
++                          || (au_test_nfs_noacl(d_inode(h_src_dentry))
 +                              && (!strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS)
 +                                  || !strcmp(name,
 +                                             XATTR_NAME_POSIX_ACL_DEFAULT))))
@@ -36527,9 +36503,12 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +      }
 +
 +      /* unlock it temporary */
-+      h_idst = d_inode(h_dst);
++      h_dst_userns = mnt_user_ns(h_dst->mnt);
++      h_dst_dentry = h_dst->dentry;
++      h_idst = d_inode(h_dst_dentry);
 +      inode_unlock(h_idst);
-+      err = vfsub_setxattr(h_dst, name, *buf, ssz, /*flags*/0);
++      err = vfsub_setxattr(h_dst_userns, h_dst_dentry, name, *buf, ssz,
++                           /*flags*/0);
 +      inode_lock_nested(h_idst, AuLsc_I_CHILD2);
 +      if (unlikely(err)) {
 +              if (verbose || au_debug_test())
@@ -36541,25 +36520,28 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +      return err;
 +}
 +
-+int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags,
++int au_cpup_xattr(struct path *h_dst, struct path *h_src, int ignore_flags,
 +                unsigned int verbose)
 +{
 +      int err, unlocked, acl_access, acl_default;
 +      ssize_t ssz;
++      struct dentry *h_dst_dentry, *h_src_dentry;
 +      struct inode *h_isrc, *h_idst;
 +      char *value, *p, *o, *e;
 +
 +      /* try stopping to update the source inode while we are referencing */
 +      /* there should not be the parent-child relationship between them */
-+      h_isrc = d_inode(h_src);
-+      h_idst = d_inode(h_dst);
++      h_dst_dentry = h_dst->dentry;
++      h_idst = d_inode(h_dst_dentry);
++      h_src_dentry = h_src->dentry;
++      h_isrc = d_inode(h_src_dentry);
 +      inode_unlock(h_idst);
 +      inode_lock_shared_nested(h_isrc, AuLsc_I_CHILD);
 +      inode_lock_nested(h_idst, AuLsc_I_CHILD2);
 +      unlocked = 0;
 +
 +      /* some filesystems don't list POSIX ACL, for example tmpfs */
-+      ssz = vfs_listxattr(h_src, NULL, 0);
++      ssz = vfs_listxattr(h_src_dentry, NULL, 0);
 +      err = ssz;
 +      if (unlikely(err < 0)) {
 +              AuTraceErr(err);
@@ -36578,7 +36560,7 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +              o = p;
 +              if (unlikely(!p))
 +                      goto out;
-+              err = vfs_listxattr(h_src, p, ssz);
++              err = vfs_listxattr(h_src_dentry, p, ssz);
 +      }
 +      inode_unlock_shared(h_isrc);
 +      unlocked = 1;
@@ -36631,7 +36613,7 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +
 +static int au_smack_reentering(struct super_block *sb)
 +{
-+#if IS_ENABLED(CONFIG_SECURITY_SMACK)
++#if IS_ENABLED(CONFIG_SECURITY_SMACK) || IS_ENABLED(CONFIG_SECURITY_SELINUX)
 +      /*
 +       * as a part of lookup, smack_d_instantiate() is called, and it calls
 +       * i_op->getxattr(). ouch.
@@ -36662,7 +36644,8 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +      } u;
 +};
 +
-+static ssize_t au_lgxattr(struct dentry *dentry, struct au_lgxattr *arg)
++static ssize_t au_lgxattr(struct dentry *dentry, struct inode *inode,
++                        struct au_lgxattr *arg)
 +{
 +      ssize_t err;
 +      int reenter;
@@ -36676,7 +36659,7 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +              if (unlikely(err))
 +                      goto out;
 +      }
-+      err = au_h_path_getattr(dentry, /*force*/1, &h_path, reenter);
++      err = au_h_path_getattr(dentry, inode, /*force*/1, &h_path, reenter);
 +      if (unlikely(err))
 +              goto out_si;
 +      if (unlikely(!h_path.dentry))
@@ -36691,7 +36674,7 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +              break;
 +      case AU_XATTR_GET:
 +              AuDebugOn(d_is_negative(h_path.dentry));
-+              err = vfs_getxattr(h_path.dentry,
++              err = vfs_getxattr(mnt_user_ns(h_path.mnt), h_path.dentry,
 +                                 arg->u.get.name, arg->u.get.value,
 +                                 arg->u.get.size);
 +              break;
@@ -36718,11 +36701,10 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +              },
 +      };
 +
-+      return au_lgxattr(dentry, &arg);
++      return au_lgxattr(dentry, /*inode*/NULL, &arg);
 +}
 +
-+static ssize_t au_getxattr(struct dentry *dentry,
-+                         struct inode *inode __maybe_unused,
++static ssize_t au_getxattr(struct dentry *dentry, struct inode *inode,
 +                         const char *name, void *value, size_t size)
 +{
 +      struct au_lgxattr arg = {
@@ -36734,7 +36716,7 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +              },
 +      };
 +
-+      return au_lgxattr(dentry, &arg);
++      return au_lgxattr(dentry, inode, &arg);
 +}
 +
 +static int au_setxattr(struct dentry *dentry, struct inode *inode,
@@ -36764,6 +36746,7 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +}
 +
 +static int au_xattr_set(const struct xattr_handler *handler,
++                      struct user_namespace *userns,
 +                      struct dentry *dentry, struct inode *inode,
 +                      const char *name, const void *value, size_t size,
 +                      int flags)
@@ -36793,8 +36776,8 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +}
 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       2020-03-30 09:50:57.598730603 +0200
-@@ -0,0 +1,1966 @@
++++ linux/fs/aufs/xino.c       2021-05-02 20:15:14.676670793 +0200
+@@ -0,0 +1,1925 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2020 Junjiro R. Okajima
@@ -37055,7 +37038,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      }
 +
 +      /* no need to mnt_want_write() since we call dentry_open() later */
-+      err = vfs_create(dir, path.dentry, 0666, NULL);
++      err = vfs_create(mnt_user_ns(base->mnt), dir, path.dentry, 0666, NULL);
 +      if (unlikely(err)) {
 +              file = ERR_PTR(err);
 +              pr_err("%pd create err %d\n", dentry, err);
@@ -37457,8 +37440,8 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      ino_t h_ino, ino;
 +};
 +
-+static int au_xino_do_write(vfs_writef_t write, struct file *file,
-+                          struct au_xi_calc *calc, ino_t ino);
++static int au_xino_do_write(struct file *file, struct au_xi_calc *calc,
++                          ino_t ino);
 +
 +static void au_xino_call_do_new_async(void *args)
 +{
@@ -37487,7 +37470,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +
 +      file = au_xino_file(br->br_xino, a->calc.idx);
 +      AuDebugOn(!file);
-+      err = au_xino_do_write(sbi->si_xwrite, file, &a->calc, a->ino);
++      err = au_xino_do_write(file, &a->calc, a->ino);
 +      if (unlikely(err)) {
 +              AuIOErr("err %d\n", err);
 +              goto out;
@@ -37588,7 +37571,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +              return 0; /* no xino */
 +
 +      sbinfo = au_sbi(sb);
-+      sz = xino_fread(sbinfo->si_xread, file, ino, sizeof(*ino), &calc.pos);
++      sz = xino_fread(file, ino, sizeof(*ino), &calc.pos);
 +      if (sz == sizeof(*ino))
 +              return 0; /* success */
 +
@@ -37600,12 +37583,12 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      return err;
 +}
 +
-+static int au_xino_do_write(vfs_writef_t write, struct file *file,
-+                          struct au_xi_calc *calc, ino_t ino)
++static int au_xino_do_write(struct file *file, struct au_xi_calc *calc,
++                          ino_t ino)
 +{
 +      ssize_t sz;
 +
-+      sz = xino_fwrite(write, file, &ino, sizeof(ino), &calc->pos);
++      sz = xino_fwrite(file, &ino, sizeof(ino), &calc->pos);
 +      if (sz == sizeof(ino))
 +              return 0; /* success */
 +
@@ -37655,7 +37638,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +              goto out;
 +      }
 +
-+      err = au_xino_do_write(au_sbi(sb)->si_xwrite, file, &calc, ino);
++      err = au_xino_do_write(file, &calc, ino);
 +      if (!err) {
 +              br = au_sbr(sb, bindex);
 +              if (au_opt_test(mnt_flags, TRUNC_XINO)
@@ -37669,40 +37652,27 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      return -EIO;
 +}
 +
-+static ssize_t xino_fread_wkq(vfs_readf_t func, struct file *file, void *buf,
-+                            size_t size, loff_t *pos);
++static ssize_t xino_fread_wkq(struct file *file, void *buf, size_t size,
++                            loff_t *pos);
 +
 +/* todo: unnecessary to support mmap_sem since kernel-space? */
-+ssize_t xino_fread(vfs_readf_t func, struct file *file, void *kbuf, size_t size,
-+                 loff_t *pos)
++ssize_t xino_fread(struct file *file, void *kbuf, size_t size, loff_t *pos)
 +{
 +      ssize_t err;
-+      mm_segment_t oldfs;
-+      union {
-+              void *k;
-+              char __user *u;
-+      } buf;
 +      int i;
 +      const int prevent_endless = 10;
 +
 +      i = 0;
-+      buf.k = kbuf;
-+      oldfs = get_fs();
-+      set_fs(KERNEL_DS);
 +      do {
-+              err = func(file, buf.u, size, pos);
++              err = vfsub_read_k(file, kbuf, size, pos);
 +              if (err == -EINTR
 +                  && !au_wkq_test()
 +                  && fatal_signal_pending(current)) {
-+                      set_fs(oldfs);
-+                      err = xino_fread_wkq(func, file, kbuf, size, pos);
++                      err = xino_fread_wkq(file, kbuf, size, pos);
 +                      BUG_ON(err == -EINTR);
-+                      oldfs = get_fs();
-+                      set_fs(KERNEL_DS);
 +              }
 +      } while (i++ < prevent_endless
 +               && (err == -EAGAIN || err == -EINTR));
-+      set_fs(oldfs);
 +
 +#if 0 /* reserved for future use */
 +      if (err > 0)
@@ -37714,7 +37684,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +
 +struct xino_fread_args {
 +      ssize_t *errp;
-+      vfs_readf_t func;
 +      struct file *file;
 +      void *buf;
 +      size_t size;
@@ -37724,17 +37693,16 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +static void call_xino_fread(void *args)
 +{
 +      struct xino_fread_args *a = args;
-+      *a->errp = xino_fread(a->func, a->file, a->buf, a->size, a->pos);
++      *a->errp = xino_fread(a->file, a->buf, a->size, a->pos);
 +}
 +
-+static ssize_t xino_fread_wkq(vfs_readf_t func, struct file *file, void *buf,
-+                            size_t size, loff_t *pos)
++static ssize_t xino_fread_wkq(struct file *file, void *buf, size_t size,
++                            loff_t *pos)
 +{
 +      ssize_t err;
 +      int wkq_err;
 +      struct xino_fread_args args = {
 +              .errp   = &err,
-+              .func   = func,
 +              .file   = file,
 +              .buf    = buf,
 +              .size   = size,
@@ -37748,39 +37716,27 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      return err;
 +}
 +
-+static ssize_t xino_fwrite_wkq(vfs_writef_t func, struct file *file, void *buf,
-+                             size_t size, loff_t *pos);
++static ssize_t xino_fwrite_wkq(struct file *file, void *buf, size_t size,
++                             loff_t *pos);
 +
-+static ssize_t do_xino_fwrite(vfs_writef_t func, struct file *file, void *kbuf,
-+                            size_t size, loff_t *pos)
++static ssize_t do_xino_fwrite(struct file *file, void *kbuf, size_t size,
++                            loff_t *pos)
 +{
 +      ssize_t err;
-+      mm_segment_t oldfs;
-+      union {
-+              void *k;
-+              const char __user *u;
-+      } buf;
 +      int i;
 +      const int prevent_endless = 10;
 +
 +      i = 0;
-+      buf.k = kbuf;
-+      oldfs = get_fs();
-+      set_fs(KERNEL_DS);
 +      do {
-+              err = func(file, buf.u, size, pos);
++              err = vfsub_write_k(file, kbuf, size, pos);
 +              if (err == -EINTR
 +                  && !au_wkq_test()
 +                  && fatal_signal_pending(current)) {
-+                      set_fs(oldfs);
-+                      err = xino_fwrite_wkq(func, file, kbuf, size, pos);
++                      err = xino_fwrite_wkq(file, kbuf, size, pos);
 +                      BUG_ON(err == -EINTR);
-+                      oldfs = get_fs();
-+                      set_fs(KERNEL_DS);
 +              }
 +      } while (i++ < prevent_endless
 +               && (err == -EAGAIN || err == -EINTR));
-+      set_fs(oldfs);
 +
 +#if 0 /* reserved for future use */
 +      if (err > 0)
@@ -37792,7 +37748,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +
 +struct do_xino_fwrite_args {
 +      ssize_t *errp;
-+      vfs_writef_t func;
 +      struct file *file;
 +      void *buf;
 +      size_t size;
@@ -37802,17 +37757,16 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +static void call_do_xino_fwrite(void *args)
 +{
 +      struct do_xino_fwrite_args *a = args;
-+      *a->errp = do_xino_fwrite(a->func, a->file, a->buf, a->size, a->pos);
++      *a->errp = do_xino_fwrite(a->file, a->buf, a->size, a->pos);
 +}
 +
-+static ssize_t xino_fwrite_wkq(vfs_writef_t func, struct file *file, void *buf,
-+                             size_t size, loff_t *pos)
++static ssize_t xino_fwrite_wkq(struct file *file, void *buf, size_t size,
++                             loff_t *pos)
 +{
 +      ssize_t err;
 +      int wkq_err;
 +      struct do_xino_fwrite_args args = {
 +              .errp   = &err,
-+              .func   = func,
 +              .file   = file,
 +              .buf    = buf,
 +              .size   = size,
@@ -37830,18 +37784,17 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      return err;
 +}
 +
-+ssize_t xino_fwrite(vfs_writef_t func, struct file *file, void *buf,
-+                  size_t size, loff_t *pos)
++ssize_t xino_fwrite(struct file *file, void *buf, size_t size, loff_t *pos)
 +{
 +      ssize_t err;
 +
 +      if (rlimit(RLIMIT_FSIZE) == RLIM_INFINITY) {
 +              lockdep_off();
-+              err = do_xino_fwrite(func, file, buf, size, pos);
++              err = do_xino_fwrite(file, buf, size, pos);
 +              lockdep_on();
 +      } else {
 +              lockdep_off();
-+              err = xino_fwrite_wkq(func, file, buf, size, pos);
++              err = xino_fwrite_wkq(file, buf, size, pos);
 +              lockdep_on();
 +      }
 +
@@ -37892,17 +37845,17 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      p = sbinfo->si_xib_buf;
 +      pos = sbinfo->si_xib_last_pindex;
 +      pos *= PAGE_SIZE;
-+      sz = xino_fwrite(sbinfo->si_xwrite, xib, p, PAGE_SIZE, &pos);
++      sz = xino_fwrite(xib, p, PAGE_SIZE, &pos);
 +      if (unlikely(sz != PAGE_SIZE))
 +              goto out;
 +
 +      pos = pindex;
 +      pos *= PAGE_SIZE;
 +      if (vfsub_f_size_read(xib) >= pos + PAGE_SIZE)
-+              sz = xino_fread(sbinfo->si_xread, xib, p, PAGE_SIZE, &pos);
++              sz = xino_fread(xib, p, PAGE_SIZE, &pos);
 +      else {
 +              memset(p, 0, PAGE_SIZE);
-+              sz = xino_fwrite(sbinfo->si_xwrite, xib, p, PAGE_SIZE, &pos);
++              sz = xino_fwrite(xib, p, PAGE_SIZE, &pos);
 +      }
 +      if (sz == PAGE_SIZE) {
 +              sbinfo->si_xib_last_pindex = pindex;
@@ -37953,7 +37906,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      unsigned long pindex;
 +      loff_t pos, pend;
 +      struct au_sbinfo *sbinfo;
-+      vfs_readf_t func;
 +      ino_t *ino;
 +      unsigned long *p;
 +
@@ -37961,11 +37913,10 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      sbinfo = au_sbi(sb);
 +      MtxMustLock(&sbinfo->si_xib_mtx);
 +      p = sbinfo->si_xib_buf;
-+      func = sbinfo->si_xread;
 +      pend = vfsub_f_size_read(file);
 +      pos = 0;
 +      while (pos < pend) {
-+              sz = xino_fread(func, file, page, PAGE_SIZE, &pos);
++              sz = xino_fread(file, page, PAGE_SIZE, &pos);
 +              err = sz;
 +              if (unlikely(sz <= 0))
 +                      goto out;
@@ -38054,7 +38005,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      p = sbinfo->si_xib_buf;
 +      memset(p, 0, PAGE_SIZE);
 +      pos = 0;
-+      sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xib, p, PAGE_SIZE, &pos);
++      sz = xino_fwrite(sbinfo->si_xib, p, PAGE_SIZE, &pos);
 +      if (unlikely(sz != PAGE_SIZE)) {
 +              err = sz;
 +              AuIOErr("err %d\n", err);
@@ -38193,7 +38144,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      SiMustWriteLock(sb);
 +
 +      sbinfo = au_sbi(sb);
-+      /* unnecessary to clear sbinfo->si_xread and ->si_xwrite */
 +      if (sbinfo->si_xib)
 +              fput(sbinfo->si_xib);
 +      sbinfo->si_xib = NULL;
@@ -38220,8 +38170,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      if (sbinfo->si_xib)
 +              fput(sbinfo->si_xib);
 +      sbinfo->si_xib = file;
-+      sbinfo->si_xread = vfs_readf(file);
-+      sbinfo->si_xwrite = vfs_writef(file);
 +      xi_sb = file_inode(file)->i_sb;
 +      sbinfo->si_ximaxent = xi_sb->s_maxbytes;
 +      if (unlikely(sbinfo->si_ximaxent < PAGE_SIZE)) {
@@ -38242,8 +38190,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      sbinfo->si_xib_next_bit = 0;
 +      if (vfsub_f_size_read(file) < PAGE_SIZE) {
 +              pos = 0;
-+              err = xino_fwrite(sbinfo->si_xwrite, file, sbinfo->si_xib_buf,
-+                                PAGE_SIZE, &pos);
++              err = xino_fwrite(file, sbinfo->si_xib_buf, PAGE_SIZE, &pos);
 +              if (unlikely(err != PAGE_SIZE))
 +                      goto out_free;
 +      }
@@ -38294,7 +38241,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +}
 +
 +struct au_xino_do_set_br {
-+      vfs_writef_t writef;
 +      struct au_branch *br;
 +      ino_t h_ino;
 +      aufs_bindex_t bshared;
@@ -38336,7 +38282,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +              goto out;
 +      AuDebugOn(!file);
 +
-+      err = au_xino_do_write(args->writef, file, &calc, AUFS_ROOT_INO);
++      err = au_xino_do_write(file, &calc, AUFS_ROOT_INO);
 +      if (unlikely(err))
 +              au_xino_put(br);
 +
@@ -38356,7 +38302,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +
 +      bbot = au_sbbot(sb);
 +      inode = d_inode(sb->s_root);
-+      args.writef = au_sbi(sb)->si_xwrite;
 +      for (bindex = 0; bindex <= bbot; bindex++) {
 +              args.h_ino = au_h_iptr(inode, bindex)->i_ino;
 +              args.br = au_sbr(sb, bindex);
@@ -38511,7 +38456,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +              .br     = br
 +      };
 +
-+      args.writef = au_sbi(sb)->si_xwrite;
 +      args.bshared = sbr_find_shared(sb, /*btop*/0, au_sbbot(sb),
 +                                     au_br_sb(br));
 +      err = au_xino_do_set_br(sb, base, &args);
@@ -38595,7 +38539,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      struct au_hinode *hi;
 +      struct inode *h_inode;
 +      struct au_branch *br;
-+      vfs_writef_t xwrite;
 +      struct au_xi_calc calc;
 +      struct file *file;
 +
@@ -38617,7 +38560,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +      if (bindex < 0)
 +              return;
 +
-+      xwrite = au_sbi(sb)->si_xwrite;
 +      try_trunc = !!au_opt_test(mnt_flags, TRUNC_XINO);
 +      hi = au_hinode(iinfo, bindex);
 +      bbot = iinfo->ii_bbot;
@@ -38638,7 +38580,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +              if (IS_ERR_OR_NULL(file))
 +                      continue;
 +
-+              err = au_xino_do_write(xwrite, file, &calc, /*ino*/0);
++              err = au_xino_do_write(file, &calc, /*ino*/0);
 +              if (!err && try_trunc
 +                  && au_test_fs_trunc_xino(au_br_sb(br)))
 +                      xino_try_trunc(sb, br);
@@ -38763,7 +38705,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +}
 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       2020-03-30 09:50:57.598730603 +0200
++++ linux/include/uapi/linux/aufs_type.h       2021-05-02 20:15:14.676670793 +0200
 @@ -0,0 +1,452 @@
 +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
 +/*
@@ -38807,7 +38749,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +#include <limits.h>
 +#endif /* __KERNEL__ */
 +
-+#define AUFS_VERSION  "5.x-rcN-20200302"
++#define AUFS_VERSION  "5.12-20210503"
 +
 +/* todo? move this to linux-2.6.19/include/magic.h */
 +#define AUFS_SUPER_MAGIC      ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
@@ -39054,7 +38996,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +      uint8_t         type;
 +      uint8_t         nlen;
 +      uint8_t         wh;
-+      char            name[0];
++      char            name[];
 +} __aligned(8);
 +
 +static inline int au_rdu_len(int nlen)
@@ -39105,7 +39047,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +              uint8_t oldnamelen;
 +              uint64_t _padding;
 +      };
-+      uint8_t oldname[0];
++      uint8_t oldname[];
 +} __aligned(8);
 +
 +struct au_drinfo_fdata {
@@ -39199,7 +39141,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +      struct {
 +              int16_t id;
 +              int     perm;
-+              char    path[0];
++              char    path[];
 +      };
 +} __aligned(8);
 +
@@ -39218,14 +39160,14 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +
 +#endif /* __AUFS_TYPE_H__ */
 SPDX-License-Identifier: GPL-2.0
-aufs5.x-rcN loopback patch
+aufs5.12 loopback patch
 
 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 872e3b3a7693..768100025129 100644
+index 01ca256575fb2..f5a76bacf6c85 100644
 --- a/drivers/block/loop.c
 +++ b/drivers/block/loop.c
-@@ -635,6 +635,15 @@ static inline void loop_update_dio(struct loop_device *lo)
-                       lo->use_dio);
+@@ -646,6 +646,15 @@ static inline void loop_update_dio(struct loop_device *lo)
+                               lo->use_dio);
  }
  
 +static struct file *loop_real_file(struct file *file)
@@ -39240,7 +39182,7 @@ index 872e3b3a7693..768100025129 100644
  static void loop_reread_partitions(struct loop_device *lo,
                                   struct block_device *bdev)
  {
-@@ -690,6 +699,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -701,6 +710,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
                          unsigned int arg)
  {
        struct file     *file = NULL, *old_file;
@@ -39248,7 +39190,7 @@ index 872e3b3a7693..768100025129 100644
        int             error;
        bool            partscan;
  
-@@ -709,12 +719,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -720,12 +730,19 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
        file = fget(arg);
        if (!file)
                goto out_err;
@@ -39268,7 +39210,7 @@ index 872e3b3a7693..768100025129 100644
  
        error = -EINVAL;
  
-@@ -726,6 +743,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -737,6 +754,7 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
        blk_mq_freeze_queue(lo->lo_queue);
        mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
        lo->lo_backing_file = file;
@@ -39276,7 +39218,7 @@ index 872e3b3a7693..768100025129 100644
        lo->old_gfp_mask = mapping_gfp_mask(file->f_mapping);
        mapping_set_gfp_mask(file->f_mapping,
                             lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
-@@ -739,6 +757,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+@@ -750,6 +768,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
         * dependency.
         */
        fput(old_file);
@@ -39285,8 +39227,8 @@ index 872e3b3a7693..768100025129 100644
        if (partscan)
                loop_reread_partitions(lo, bdev);
        return 0;
-@@ -747,6 +767,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
-       mutex_unlock(&loop_ctl_mutex);
+@@ -758,6 +778,8 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+       mutex_unlock(&lo->lo_mutex);
        if (file)
                fput(file);
 +      if (virt_file)
@@ -39294,17 +39236,17 @@ index 872e3b3a7693..768100025129 100644
        return error;
  }
  
-@@ -951,7 +973,7 @@ static void loop_update_rotational(struct loop_device *lo)
static int loop_set_fd(struct loop_device *lo, fmode_t mode,
-                      struct block_device *bdev, unsigned int arg)
+@@ -1084,7 +1106,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
                        struct block_device *bdev,
+                         const struct loop_config *config)
  {
 -      struct file     *file;
 +      struct file     *file, *f, *virt_file = NULL;
        struct inode    *inode;
        struct address_space *mapping;
-       struct block_device *claimed_bdev = NULL;
-@@ -967,6 +989,12 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
-       file = fget(arg);
+       int             error;
+@@ -1099,6 +1121,12 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
+       file = fget(config->fd);
        if (!file)
                goto out;
 +      f = loop_real_file(file);
@@ -39316,16 +39258,16 @@ index 872e3b3a7693..768100025129 100644
  
        /*
         * If we don't hold exclusive handle for the device, upgrade to it
-@@ -1015,6 +1043,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
+@@ -1153,6 +1181,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
+       lo->use_dio = lo->lo_flags & LO_FLAGS_DIRECT_IO;
        lo->lo_device = bdev;
-       lo->lo_flags = lo_flags;
        lo->lo_backing_file = file;
 +      lo->lo_backing_virt_file = virt_file;
-       lo->transfer = NULL;
-       lo->ioctl = NULL;
-       lo->lo_sizelimit = 0;
-@@ -1068,6 +1097,8 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
-               bd_abort_claiming(bdev, claimed_bdev, loop_set_fd);
+       lo->old_gfp_mask = mapping_gfp_mask(mapping);
+       mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
+@@ -1203,6 +1232,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
+               bd_abort_claiming(bdev, loop_configure);
  out_putf:
        fput(file);
 +      if (virt_file)
@@ -39333,7 +39275,7 @@ index 872e3b3a7693..768100025129 100644
  out:
        /* This is safe: open() is still holding a reference. */
        module_put(THIS_MODULE);
-@@ -1114,6 +1145,7 @@ loop_init_xfer(struct loop_device *lo, struct loop_func_table *xfer,
+@@ -1212,6 +1243,7 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
  static int __loop_clr_fd(struct loop_device *lo, bool release)
  {
        struct file *filp = NULL;
@@ -39341,7 +39283,7 @@ index 872e3b3a7693..768100025129 100644
        gfp_t gfp = lo->old_gfp_mask;
        struct block_device *bdev = lo->lo_device;
        int err = 0;
-@@ -1137,6 +1169,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
+@@ -1238,6 +1270,7 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
  
        spin_lock_irq(&lo->lo_lock);
        lo->lo_backing_file = NULL;
@@ -39349,7 +39291,7 @@ index 872e3b3a7693..768100025129 100644
        spin_unlock_irq(&lo->lo_lock);
  
        loop_release_xfer(lo);
-@@ -1220,6 +1253,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
+@@ -1319,6 +1352,8 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
         */
        if (filp)
                fput(filp);
@@ -39359,7 +39301,7 @@ index 872e3b3a7693..768100025129 100644
  }
  
 diff --git a/drivers/block/loop.h b/drivers/block/loop.h
-index af75a5ee4094..1d847cb194ff 100644
+index a3c04f310672e..161c3c5d1c22b 100644
 --- a/drivers/block/loop.h
 +++ b/drivers/block/loop.h
 @@ -46,7 +46,7 @@ struct loop_device {
@@ -39372,10 +39314,10 @@ index af75a5ee4094..1d847cb194ff 100644
        void            *key_data; 
  
 diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
-index 6fb4a4ed8cc7..ba9a959f2db2 100644
+index 9f58ba0cb769f..1c2267a5a2ae1 100644
 --- a/fs/aufs/f_op.c
 +++ b/fs/aufs/f_op.c
-@@ -359,7 +359,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
+@@ -304,7 +304,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
        if (IS_ERR(h_file))
                goto out;
  
@@ -39385,7 +39327,7 @@ index 6fb4a4ed8cc7..ba9a959f2db2 100644
                if (file->f_mapping != h_file->f_mapping) {
                        file->f_mapping = h_file->f_mapping;
 diff --git a/fs/aufs/loop.c b/fs/aufs/loop.c
-index a8b63acc6204..9d97c3af5686 100644
+index a8b63acc62045..9d97c3af5686a 100644
 --- a/fs/aufs/loop.c
 +++ b/fs/aufs/loop.c
 @@ -133,3 +133,19 @@ void au_loopback_fin(void)
@@ -39409,7 +39351,7 @@ index a8b63acc6204..9d97c3af5686 100644
 +      return f;
 +}
 diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h
-index 94f4f80ae33b..ca1194354aff 100644
+index 94f4f80ae33bf..ca1194354aff4 100644
 --- a/fs/aufs/loop.h
 +++ b/fs/aufs/loop.h
 @@ -26,6 +26,8 @@ void au_warn_loopback(struct super_block *h_sb);
@@ -39431,7 +39373,7 @@ index 94f4f80ae33b..ca1194354aff 100644
  
  #endif /* __KERNEL__ */
 diff --git a/fs/aufs/super.c b/fs/aufs/super.c
-index 589dd0122020..801e0a7faec5 100644
+index d252963a87b53..ecfc5fc96ad8c 100644
 --- a/fs/aufs/super.c
 +++ b/fs/aufs/super.c
 @@ -844,7 +844,10 @@ static const struct super_operations aufs_sop = {
@@ -39447,10 +39389,10 @@ index 589dd0122020..801e0a7faec5 100644
  
  /* ---------------------------------------------------------------------- */
 diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 6d1e37a014f3..ce2c9b4bae13 100644
+index 4fa4b24535fde..2aec4bc9f5aa1 100644
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
-@@ -1979,6 +1979,10 @@ struct super_operations {
+@@ -2041,6 +2041,10 @@ struct super_operations {
                                  struct shrink_control *);
        long (*free_cached_objects)(struct super_block *,
                                    struct shrink_control *);
This page took 0.24024 seconds and 4 git commands to generate.