[packages/kernel/LINUX_4_14] - 4.14.222, rediffed patches
baggins
baggins at pld-linux.org
Wed Feb 24 21:54:46 CET 2021
commit 0b1ff5c39eea82ab2fe9536956ae20c2bd9776cc
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Wed Feb 24 21:53:49 2021 +0100
- 4.14.222, rediffed patches
kernel-atm-vbr.patch | 34 +-
kernel-atmdd.patch | 42 +-
kernel-aufs4.patch | 17414 ++++++++++++++++++------------------
kernel-hostap.patch | 68 +-
kernel-layer7.patch | 3591 ++++----
kernel-pom-ng-IPV4OPTSSTRIP.patch | 29 +-
kernel-rndis_host-wm5.patch | 13 +-
kernel-small_fixes.patch | 40 +-
kernel.spec | 4 +-
9 files changed, 10532 insertions(+), 10703 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index f1ec1dc7..6081d32e 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -70,7 +70,7 @@
%define rel 1
%define basever 4.14
-%define postver .221
+%define postver .222
# define this to '-%{basever}' for longterm branch
%define versuffix -%{basever}
@@ -122,7 +122,7 @@ Source0: https://www.kernel.org/pub/linux/kernel/v4.x/linux-%{basever}.tar.xz
# Source0-md5: bacdb9ffdcd922aa069a5e1520160e24
%if "%{postver}" != ".0"
Patch0: https://www.kernel.org/pub/linux/kernel/v4.x/patch-%{version}.xz
-# Patch0-md5: a0f050c4f4d5a91bd00cee176575c13a
+# Patch0-md5: fc6eacf51360504b802cbfb7b4d094d6
%endif
Source1: kernel.sysconfig
diff --git a/kernel-atm-vbr.patch b/kernel-atm-vbr.patch
index 28dc14b8..803b9e2f 100644
--- a/kernel-atm-vbr.patch
+++ b/kernel-atm-vbr.patch
@@ -1,11 +1,7 @@
-Index: linux/include/linux/atm.h
-===================================================================
-RCS file: /afs/cmf/project/cvsroot/linux/include/linux/atm.h,v
-retrieving revision 1.2
-diff -u -r1.2 atm.h
---- linux/include/uapi/linux/atm.h 12 Feb 2003 20:56:33 -0000 1.2
-+++ linux/include/uapi/linux/atm.h 9 Apr 2003 12:08:38 -0000
-@@ -72,7 +72,7 @@
+diff -urNp -x '*.orig' linux-4.14/include/uapi/linux/atm.h linux-4.14/include/uapi/linux/atm.h
+--- linux-4.14/include/uapi/linux/atm.h 2017-11-12 19:46:13.000000000 +0100
++++ linux-4.14/include/uapi/linux/atm.h 2021-02-24 21:41:31.414774619 +0100
+@@ -71,7 +71,7 @@
/* connection identifier range; socket must be
bound or connected */
#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
@@ -27,7 +23,7 @@ diff -u -r1.2 atm.h
#define ATM_MAX_PCR -1 /* maximum available PCR */
-@@ -140,6 +142,11 @@
+@@ -140,6 +142,11 @@ struct atm_trafprm {
int min_pcr; /* minimum PCR in cells per second */
int max_cdv; /* maximum CDV in microseconds */
int max_sdu; /* maximum SDU in bytes */
@@ -39,8 +35,8 @@ diff -u -r1.2 atm.h
/* extra params for ABR */
unsigned int icr; /* Initial Cell Rate (24-bit) */
unsigned int tbe; /* Transient Buffer Exposure (24-bit) */
-@@ -243,4 +251,37 @@
- };
+@@ -239,4 +246,37 @@ struct atmif_sioc {
+
typedef unsigned short atm_backend_t;
+struct atm_trafprm_compat {
@@ -77,14 +73,10 @@ diff -u -r1.2 atm.h
+#define SO_ATMQOS_COMPAT __SO_ENCODE(SOL_ATM,2,struct atm_qos_compat)
+ /* Quality of Service setting (no vbr support) */
#endif /* _UAPI_LINUX_ATM_H */
-Index: linux/net/atm/common.c
-===================================================================
-RCS file: /afs/cmf/project/cvsroot/linux/net/atm/common.c,v
-retrieving revision 1.13
-diff -u -r1.13 common.c
---- linux/net/atm/common.c 17 Mar 2003 16:13:12 -0000 1.13
-+++ linux/net/atm/common.c 9 Apr 2003 12:10:28 -0000
-@@ -1085,6 +1085,43 @@
+diff -urNp -x '*.orig' linux-4.14/net/atm/common.c linux-4.14/net/atm/common.c
+--- linux-4.14/net/atm/common.c 2021-02-24 21:41:23.698170252 +0100
++++ linux-4.14/net/atm/common.c 2021-02-24 21:41:31.414774619 +0100
+@@ -755,6 +755,43 @@ int vcc_setsockopt(struct socket *sock,
vcc = ATM_SD(sock);
switch (optname) {
@@ -128,7 +120,7 @@ diff -u -r1.13 common.c
case SO_ATMQOS:
{
struct atm_qos qos;
-@@ -1132,6 +1169,31 @@
+@@ -803,6 +840,31 @@ int vcc_getsockopt(struct socket *sock,
vcc = ATM_SD(sock);
switch (optname) {
@@ -158,5 +150,5 @@ diff -u -r1.13 common.c
+ -EFAULT : 0;
+ }
case SO_ATMQOS:
- if (!test_bit(ATM_VF_HASQOS,&vcc->flags))
+ if (!test_bit(ATM_VF_HASQOS, &vcc->flags))
return -EINVAL;
diff --git a/kernel-atmdd.patch b/kernel-atmdd.patch
index a380fce1..32c685a9 100644
--- a/kernel-atmdd.patch
+++ b/kernel-atmdd.patch
@@ -1,22 +1,10 @@
-diff -urN linux-2.4.25/drivers/atm/Makefile linux-2.4.25-atmdd/drivers/atm/Makefile
---- linux-2.4.25/drivers/atm/Makefile 2004-02-23 15:18:29.000000000 +0100
-+++ linux-2.4.25-atmdd/drivers/atm/Makefile 2004-02-29 22:51:26.000000000 +0100
-@@ -31,6 +31,7 @@
- endif
-
- obj-$(CONFIG_ATM_DUMMY) += adummy.o
-+obj-$(CONFIG_ATM_DD) += atmdd.o
- obj-$(CONFIG_ATM_TCP) += atmtcp.o
- obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
- obj-$(CONFIG_ATM_LANAI) += lanai.o
-diff -urN linux-2.4.25/drivers/atm/Kconfig linux-2.4.25-atmdd/drivers/atm/Kconfig
---- linux-2.4.25/drivers/atm/Kcnfig 2003-08-25 13:44:41.000000000 +0200
-+++ linux-2.4.25-atmdd/drivers/atm/Kconfig 2004-02-29 22:52:59.000000000 +0100
-@@ -4,6 +4,14 @@
- default y
+diff -urNp -x '*.orig' linux-4.14/drivers/atm/Kconfig linux-4.14/drivers/atm/Kconfig
+--- linux-4.14/drivers/atm/Kconfig 2021-02-24 21:41:40.771374017 +0100
++++ linux-4.14/drivers/atm/Kconfig 2021-02-24 21:41:49.137987721 +0100
+@@ -15,6 +15,14 @@ menuconfig ATM_DRIVERS
if ATM_DRIVERS && NETDEVICES && ATM
-+
+
+config ATM_DD
+ tristate "ATM loopback"
+ depends on INET && ATM
@@ -24,12 +12,24 @@ diff -urN linux-2.4.25/drivers/atm/Kconfig linux-2.4.25-atmdd/drivers/atm/Kconfi
+ This is an example atm driver. It does not require any actual ATM
+ hardware. It supports AAL5 and AAL0. Frames are merely looped back
+ to the sender on the same VC they were sent.
-
++
config ATM_DUMMY
tristate "Dummy ATM driver"
-diff -urN linux-2.4.25/drivers/atm/atmdd.c linux-2.4.25-atmdd/drivers/atm/atmdd.c
---- linux-2.4.25/drivers/atm/atmdd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.4.25-atmdd/drivers/atm/atmdd.c 2004-02-29 22:58:11.000000000 +0100
+ help
+diff -urNp -x '*.orig' linux-4.14/drivers/atm/Makefile linux-4.14/drivers/atm/Makefile
+--- linux-4.14/drivers/atm/Makefile 2017-11-12 19:46:13.000000000 +0100
++++ linux-4.14/drivers/atm/Makefile 2021-02-24 21:41:49.137987721 +0100
+@@ -26,6 +26,7 @@ ifeq ($(CONFIG_ATM_IDT77252_USE_SUNI),y)
+ endif
+
+ obj-$(CONFIG_ATM_DUMMY) += adummy.o
++obj-$(CONFIG_ATM_DD) += atmdd.o
+ obj-$(CONFIG_ATM_TCP) += atmtcp.o
+ obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
+ obj-$(CONFIG_ATM_LANAI) += lanai.o
+diff -urNp -x '*.orig' linux-4.14/drivers/atm/atmdd.c linux-4.14/drivers/atm/atmdd.c
+--- linux-4.14/drivers/atm/atmdd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/drivers/atm/atmdd.c 2021-02-24 21:41:49.137987721 +0100
@@ -0,0 +1,921 @@
+/*
+#######################################################################
diff --git a/kernel-aufs4.patch b/kernel-aufs4.patch
index 655a2be8..f8c84a8d 100644
--- a/kernel-aufs4.patch
+++ b/kernel-aufs4.patch
@@ -1,1194 +1,6 @@
-aufs4.x-rcN kbuild patch
-
-diff --git a/fs/Kconfig b/fs/Kconfig
-index 7aee6d6..ec92031 100644
---- a/fs/Kconfig
-+++ b/fs/Kconfig
-@@ -248,6 +248,7 @@ source "fs/pstore/Kconfig"
- source "fs/sysv/Kconfig"
- source "fs/ufs/Kconfig"
- source "fs/exofs/Kconfig"
-+source "fs/aufs/Kconfig"
-
- endif # MISC_FILESYSTEMS
-
-diff --git a/fs/Makefile b/fs/Makefile
-index 7bbaca9..a026491 100644
---- a/fs/Makefile
-+++ b/fs/Makefile
-@@ -128,3 +128,4 @@ obj-y += exofs/ # Multiple modules
- obj-$(CONFIG_CEPH_FS) += ceph/
- obj-$(CONFIG_PSTORE) += pstore/
- obj-$(CONFIG_EFIVAR_FS) += efivarfs/
-+obj-$(CONFIG_AUFS_FS) += aufs/
-aufs4.x-rcN base patch
-
-diff --git a/MAINTAINERS b/MAINTAINERS
-index af0cb69..d360d2e 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -2465,6 +2465,19 @@ F: include/linux/audit.h
- F: include/uapi/linux/audit.h
- F: kernel/audit*
-
-+AUFS (advanced multi layered unification filesystem) FILESYSTEM
-+M: "J. R. Okajima" <hooanon05g at gmail.com>
-+L: linux-unionfs at vger.kernel.org
-+L: aufs-users at lists.sourceforge.net (members only)
-+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: fs/aufs/
-+F: include/uapi/linux/aufs_type.h
-+
- AUXILIARY DISPLAY DRIVERS
- M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis at gmail.com>
- W: http://miguelojeda.es/auxdisplay.htm
-diff --git a/drivers/block/loop.c b/drivers/block/loop.c
-index 85de673..d44de9d 100644
---- a/drivers/block/loop.c
-+++ b/drivers/block/loop.c
-@@ -686,6 +686,24 @@ static inline int is_loop_device(struct file *file)
- return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR;
- }
-
-+/*
-+ * for AUFS
-+ * no get/put for file.
-+ */
-+struct file *loop_backing_file(struct super_block *sb)
-+{
-+ struct file *ret;
-+ struct loop_device *l;
-+
-+ ret = NULL;
-+ if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
-+ l = sb->s_bdev->bd_disk->private_data;
-+ ret = l->lo_backing_file;
-+ }
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(loop_backing_file);
-+
- /* loop sysfs attributes */
-
- static ssize_t loop_attr_show(struct device *dev, char *page,
-diff --git a/fs/dcache.c b/fs/dcache.c
-index f901413..e3719a5 100644
---- a/fs/dcache.c
-+++ b/fs/dcache.c
-@@ -1197,7 +1197,7 @@ enum d_walk_ret {
- *
- * The @enter() and @finish() callbacks are called with d_lock held.
- */
--static void d_walk(struct dentry *parent, void *data,
-+void d_walk(struct dentry *parent, void *data,
- enum d_walk_ret (*enter)(void *, struct dentry *),
- void (*finish)(void *))
- {
-diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 448a111..f51c2cf 100644
---- a/fs/fcntl.c
-+++ b/fs/fcntl.c
-@@ -31,7 +31,7 @@
-
- #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
-
--static int setfl(int fd, struct file * filp, unsigned long arg)
-+int setfl(int fd, struct file * filp, unsigned long arg)
- {
- struct inode * inode = file_inode(filp);
- int error = 0;
-@@ -62,6 +62,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);
-+ if (!error && filp->f_op->setfl)
-+ error = filp->f_op->setfl(filp, arg);
- if (error)
- return error;
-
-diff --git a/fs/inode.c b/fs/inode.c
-index d1e35b5..f7800d6 100644
---- a/fs/inode.c
-+++ b/fs/inode.c
-@@ -1655,7 +1655,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.
- */
--static int update_time(struct inode *inode, struct timespec *time, int flags)
-+int update_time(struct inode *inode, struct timespec *time, int flags)
- {
- int (*update_time)(struct inode *, struct timespec *, int);
-
-diff --git a/fs/namespace.c b/fs/namespace.c
-index d18deb4..e5a4a7f 100644
---- a/fs/namespace.c
-+++ b/fs/namespace.c
-@@ -846,6 +846,12 @@ static inline int check_mnt(struct mount *mnt)
- return mnt->mnt_ns == current->nsproxy->mnt_ns;
- }
-
-+/* for aufs, CONFIG_AUFS_BR_FUSE */
-+int is_current_mnt_ns(struct vfsmount *mnt)
-+{
-+ return check_mnt(real_mount(mnt));
-+}
-+
- /*
- * vfsmount lock must be held for write
- */
-diff --git a/fs/read_write.c b/fs/read_write.c
-index f0d4b16..6aa8c7a 100644
---- a/fs/read_write.c
-+++ b/fs/read_write.c
-@@ -483,6 +483,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
- 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);
-+}
-+
-+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);
-+}
-+
- 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 f3084cc..eb888c6 100644
---- a/fs/splice.c
-+++ b/fs/splice.c
-@@ -837,8 +837,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
- /*
- * Attempt to initiate a splice from pipe to file.
- */
--static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-- loff_t *ppos, size_t len, unsigned int flags)
-+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);
-@@ -854,9 +854,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.
- */
--static long do_splice_to(struct file *in, loff_t *ppos,
-- struct pipe_inode_info *pipe, size_t len,
-- unsigned int flags)
-+long do_splice_to(struct file *in, loff_t *ppos,
-+ 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);
-diff --git a/fs/sync.c b/fs/sync.c
-index a576aa2..eb61780 100644
---- a/fs/sync.c
-+++ b/fs/sync.c
-@@ -27,7 +27,7 @@
- * wait == 1 case since in that case write_inode() functions do
- * sync_dirty_buffer() and thus effectively write one block at a time.
- */
--static int __sync_filesystem(struct super_block *sb, int wait)
-+int __sync_filesystem(struct super_block *sb, int wait)
- {
- if (wait)
- sync_inodes_sb(sb);
-diff --git a/include/linux/file.h b/include/linux/file.h
-index 61eb82c..e700888 100644
---- a/include/linux/file.h
-+++ b/include/linux/file.h
-@@ -19,6 +19,7 @@ struct dentry;
- struct path;
- extern struct file *alloc_file(const struct path *, fmode_t mode,
- const struct file_operations *fop);
-+extern struct file *get_empty_filp(void);
-
- static inline void fput_light(struct file *file, int fput_needed)
- {
-diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 13dab19..8ab6566 100644
---- a/include/linux/fs.h
-+++ b/include/linux/fs.h
-@@ -1264,6 +1264,7 @@ extern void fasync_free(struct fasync_struct *);
- /* can be called from interrupts */
- extern void kill_fasync(struct fasync_struct **, int, int);
-
-+extern int setfl(int fd, struct file * filp, unsigned long arg);
- 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);
-@@ -1710,6 +1711,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);
-+ int (*setfl)(struct file *, unsigned long);
- 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);
-@@ -1780,6 +1782,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 *);
-@@ -2182,6 +2190,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 timespec *, int);
-+extern int update_time(struct inode *, struct timespec *, int);
-
- /* /sys/fs */
- extern struct kobject *fs_kobj;
-@@ -2462,6 +2471,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
- return false;
- }
- #endif
-+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 bfa8e0b..728d810 100644
---- a/include/linux/lockdep.h
-+++ b/include/linux/lockdep.h
-@@ -405,6 +405,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
- return lock->key == key;
- }
-
-+struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
-+
- /*
- * Acquire a lock.
- *
-@@ -529,6 +531,7 @@ struct lock_class_key { };
-
- #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 12b2ab5..8b810d1 100644
---- a/include/linux/mnt_namespace.h
-+++ b/include/linux/mnt_namespace.h
-@@ -5,11 +5,14 @@
- struct mnt_namespace;
- struct fs_struct;
- struct user_namespace;
-+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 int is_current_mnt_ns(struct vfsmount *mnt);
-+
- extern const struct file_operations proc_mounts_operations;
- 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 db42746..12f3a5a 100644
---- a/include/linux/splice.h
-+++ b/include/linux/splice.h
-@@ -86,4 +86,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;
-+
-+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-+ loff_t *ppos, size_t len, unsigned int flags);
-+extern long do_splice_to(struct file *in, loff_t *ppos,
-+ struct pipe_inode_info *pipe, size_t len,
-+ unsigned int flags);
- #endif
-diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
-index e36e652..bc97a97 100644
---- a/kernel/locking/lockdep.c
-+++ b/kernel/locking/lockdep.c
-@@ -144,7 +144,7 @@ static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
- unsigned long nr_lock_classes;
- static struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
-
--static inline struct lock_class *hlock_class(struct held_lock *hlock)
-+inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
- {
- if (!hlock->class_idx) {
- /*
-@@ -155,6 +155,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
- }
- return lock_classes + hlock->class_idx - 1;
- }
-+#define hlock_class(hlock) lockdep_hlock_class(hlock)
-
- #ifdef CONFIG_LOCK_STAT
- static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);
-aufs4.x-rcN mmap patch
-
-diff --git a/fs/proc/base.c b/fs/proc/base.c
-index ad3b076..ad4a50d 100644
---- a/fs/proc/base.c
-+++ b/fs/proc/base.c
-@@ -1987,7 +1987,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
- down_read(&mm->mmap_sem);
- vma = find_exact_vma(mm, vm_start, vm_end);
- if (vma && vma->vm_file) {
-- *path = vma->vm_file->f_path;
-+ *path = vma_pr_or_file(vma)->f_path;
- path_get(path);
- rc = 0;
- }
-diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
-index 7563437..7c0dc0f 100644
---- a/fs/proc/nommu.c
-+++ b/fs/proc/nommu.c
-@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
- file = region->vm_file;
-
- if (file) {
-- struct inode *inode = file_inode(region->vm_file);
-+ struct inode *inode;
-+
-+ file = vmr_pr_or_file(region);
-+ inode = file_inode(file);
- dev = inode->i_sb->s_dev;
- ino = inode->i_ino;
- }
-diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 5589b4b..f60aea2 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, int is_pid)
- const char *name = NULL;
-
- if (file) {
-- struct inode *inode = file_inode(vma->vm_file);
-+ struct inode *inode;
-+
-+ file = vma_pr_or_file(vma);
-+ inode = file_inode(file);
- dev = inode->i_sb->s_dev;
- ino = inode->i_ino;
- pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
-@@ -1734,7 +1737,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
- struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
- struct vm_area_struct *vma = v;
- struct numa_maps *md = &numa_priv->md;
-- struct file *file = vma->vm_file;
-+ struct file *file = vma_pr_or_file(vma);
- struct mm_struct *mm = vma->vm_mm;
- struct mm_walk walk = {
- .hugetlb_entry = gather_hugetlb_stats,
-diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
-index b00b7660..93e8a86 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,
- file = vma->vm_file;
-
- if (file) {
-- struct inode *inode = file_inode(vma->vm_file);
-+ struct inode *inode;
-+
-+ file = vma_pr_or_file(vma);
-+ inode = file_inode(file);
- dev = inode->i_sb->s_dev;
- 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 065d99d..04486c3 100644
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1348,6 +1348,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
- }
- #endif
-
-+extern void vma_do_file_update_time(struct vm_area_struct *, const char[], int);
-+extern struct file *vma_do_pr_or_file(struct vm_area_struct *, const char[],
-+ int);
-+extern void vma_do_get_file(struct vm_area_struct *, const char[], int);
-+extern void vma_do_fput(struct vm_area_struct *, const char[], int);
-+
-+#define vma_file_update_time(vma) vma_do_file_update_time(vma, __func__, \
-+ __LINE__)
-+#define vma_pr_or_file(vma) vma_do_pr_or_file(vma, __func__, \
-+ __LINE__)
-+#define vma_get_file(vma) vma_do_get_file(vma, __func__, __LINE__)
-+#define vma_fput(vma) vma_do_fput(vma, __func__, __LINE__)
-+
-+#ifndef CONFIG_MMU
-+extern struct file *vmr_do_pr_or_file(struct vm_region *, const char[], int);
-+extern void vmr_do_fput(struct vm_region *, const char[], int);
-+
-+#define vmr_pr_or_file(region) vmr_do_pr_or_file(region, __func__, \
-+ __LINE__)
-+#define vmr_fput(region) vmr_do_fput(region, __func__, __LINE__)
-+#endif /* !CONFIG_MMU */
-+
- extern int access_process_vm(struct task_struct *tsk, unsigned long addr, 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 1861ea8..d85a914 100644
---- a/include/linux/mm_types.h
-+++ b/include/linux/mm_types.h
-@@ -260,6 +260,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 */
-+ struct file *vm_prfile; /* the virtual backing file or NULL */
-
- int vm_usage; /* region usage count (access under nommu_region_sem) */
- bool vm_icache_flushed : 1; /* true if the icache has been flushed for
-@@ -334,6 +335,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). */
-+ struct file *vm_prfile; /* shadow of vm_file */
- void * vm_private_data; /* was vm_pte (shared mem) */
-
- atomic_long_t swap_readahead_info;
-diff --git a/kernel/fork.c b/kernel/fork.c
-index 07cc743..b1d2b43 100644
---- a/kernel/fork.c
-+++ b/kernel/fork.c
-@@ -676,7 +676,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);
- i_mmap_lock_write(mapping);
-diff --git a/mm/Makefile b/mm/Makefile
-index e3ac3ae..745b26c 100644
---- a/mm/Makefile
-+++ b/mm/Makefile
-@@ -39,7 +39,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
- mm_init.o mmu_context.o percpu.o slab_common.o \
- compaction.o vmacache.o swap_slots.o \
- interval_tree.o list_lru.o workingset.o \
-- debug.o $(mmu-y)
-+ prfile.o debug.o $(mmu-y)
-
- obj-y += init-mm.o
-
-diff --git a/mm/filemap.c b/mm/filemap.c
-index 594d73f..7183aef 100644
---- a/mm/filemap.c
-+++ b/mm/filemap.c
-@@ -2590,7 +2590,7 @@ int filemap_page_mkwrite(struct vm_fault *vmf)
- int ret = VM_FAULT_LOCKED;
-
- sb_start_pagefault(inode->i_sb);
-- file_update_time(vmf->vma->vm_file);
-+ vma_file_update_time(vmf->vma);
- lock_page(page);
- if (page->mapping != inode->i_mapping) {
- unlock_page(page);
-diff --git a/mm/mmap.c b/mm/mmap.c
-index 680506f..081406a 100644
---- a/mm/mmap.c
-+++ b/mm/mmap.c
-@@ -171,7 +171,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)
-- fput(vma->vm_file);
-+ vma_fput(vma);
- mpol_put(vma_policy(vma));
- kmem_cache_free(vm_area_cachep, vma);
- return next;
-@@ -896,7 +896,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);
-- fput(file);
-+ vma_fput(vma);
- }
- if (next->anon_vma)
- anon_vma_merge(vma, next);
-@@ -1746,8 +1746,8 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
- return addr;
-
- unmap_and_free_vma:
-+ 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);
-@@ -2569,7 +2569,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
- goto out_free_mpol;
-
- if (new->vm_file)
-- get_file(new->vm_file);
-+ vma_get_file(new);
-
- if (new->vm_ops && new->vm_ops->open)
- new->vm_ops->open(new);
-@@ -2588,7 +2588,7 @@ int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
- if (new->vm_ops && new->vm_ops->close)
- new->vm_ops->close(new);
- if (new->vm_file)
-- fput(new->vm_file);
-+ vma_fput(new);
- unlink_anon_vmas(new);
- out_free_mpol:
- mpol_put(vma_policy(new));
-@@ -2750,7 +2750,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;
-- struct file *file;
-+ struct file *file, *prfile;
-
- pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.\n",
- current->comm, current->pid);
-@@ -2825,10 +2825,27 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
- }
- }
-
-- file = get_file(vma->vm_file);
-+ vma_get_file(vma);
-+ file = vma->vm_file;
-+ prfile = vma->vm_prfile;
- ret = do_mmap_pgoff(vma->vm_file, start, size,
- prot, flags, pgoff, &populate, NULL);
-+ if (!IS_ERR_VALUE(ret) && file && prfile) {
-+ struct vm_area_struct *new_vma;
-+
-+ new_vma = find_vma(mm, ret);
-+ if (!new_vma->vm_prfile)
-+ new_vma->vm_prfile = prfile;
-+ if (new_vma != vma)
-+ get_file(prfile);
-+ }
-+ /*
-+ * two fput()s instead of vma_fput(vma),
-+ * coz vma may not be available anymore.
-+ */
- fput(file);
-+ if (prfile)
-+ fput(prfile);
- out:
- up_write(&mm->mmap_sem);
- if (populate)
-@@ -3136,7 +3153,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)
-- get_file(new_vma->vm_file);
-+ vma_get_file(new_vma);
- if (new_vma->vm_ops && new_vma->vm_ops->open)
- new_vma->vm_ops->open(new_vma);
- vma_link(mm, new_vma, prev, rb_link, rb_parent);
-diff --git a/mm/nommu.c b/mm/nommu.c
-index 17c00d9..4bcdf94 100644
---- a/mm/nommu.c
-+++ b/mm/nommu.c
-@@ -641,7 +641,7 @@ static void __put_nommu_region(struct vm_region *region)
- up_write(&nommu_region_sem);
-
- if (region->vm_file)
-- fput(region->vm_file);
-+ vmr_fput(region);
-
- /* IO memory and memory shared directly out of the pagecache
- * from ramfs/tmpfs mustn't be released here */
-@@ -799,7 +799,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)
-- fput(vma->vm_file);
-+ vma_fput(vma);
- put_nommu_region(vma->vm_region);
- kmem_cache_free(vm_area_cachep, vma);
- }
-@@ -1321,7 +1321,7 @@ unsigned long do_mmap(struct file *file,
- goto error_just_free;
- }
- }
-- fput(region->vm_file);
-+ vmr_fput(region);
- kmem_cache_free(vm_region_jar, region);
- region = pregion;
- result = start;
-@@ -1396,10 +1396,10 @@ unsigned long do_mmap(struct file *file,
- up_write(&nommu_region_sem);
- error:
- if (region->vm_file)
-- fput(region->vm_file);
-+ vmr_fput(region);
- kmem_cache_free(vm_region_jar, region);
- if (vma->vm_file)
-- fput(vma->vm_file);
-+ vma_fput(vma);
- kmem_cache_free(vm_area_cachep, vma);
- return ret;
-
-diff --git a/mm/prfile.c b/mm/prfile.c
-new file mode 100644
-index 0000000..1ef053b
---- /dev/null
-+++ b/mm/prfile.c
-@@ -0,0 +1,85 @@
-+/*
-+ * Mainly for aufs which mmap(2) different file and wants to print different
-+ * path in /proc/PID/maps.
-+ * Call these functions via macros defined in linux/mm.h.
-+ *
-+ * See Documentation/filesystems/aufs/design/06mmap.txt
-+ *
-+ * Copyright (c) 2014-2017 Junjro R. Okajima
-+ * Copyright (c) 2014 Ian Campbell
-+ */
-+
-+#include <linux/mm.h>
-+#include <linux/file.h>
-+#include <linux/fs.h>
-+
-+/* #define PRFILE_TRACE */
-+static inline void prfile_trace(struct file *f, struct file *pr,
-+ const char func[], int line, const char func2[])
-+{
-+#ifdef PRFILE_TRACE
-+ if (pr)
-+ pr_info("%s:%d: %s, %pD2\n", func, line, func2, f);
-+#endif
-+}
-+
-+void vma_do_file_update_time(struct vm_area_struct *vma, const char func[],
-+ int line)
-+{
-+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
-+
-+ prfile_trace(f, pr, func, line, __func__);
-+ file_update_time(f);
-+ if (f && pr)
-+ file_update_time(pr);
-+}
-+
-+struct file *vma_do_pr_or_file(struct vm_area_struct *vma, const char func[],
-+ int line)
-+{
-+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
-+
-+ prfile_trace(f, pr, func, line, __func__);
-+ return (f && pr) ? pr : f;
-+}
-+
-+void vma_do_get_file(struct vm_area_struct *vma, const char func[], int line)
-+{
-+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
-+
-+ prfile_trace(f, pr, func, line, __func__);
-+ get_file(f);
-+ if (f && pr)
-+ get_file(pr);
-+}
-+
-+void vma_do_fput(struct vm_area_struct *vma, const char func[], int line)
-+{
-+ struct file *f = vma->vm_file, *pr = vma->vm_prfile;
-+
-+ prfile_trace(f, pr, func, line, __func__);
-+ fput(f);
-+ if (f && pr)
-+ fput(pr);
-+}
-+
-+#ifndef CONFIG_MMU
-+struct file *vmr_do_pr_or_file(struct vm_region *region, const char func[],
-+ int line)
-+{
-+ struct file *f = region->vm_file, *pr = region->vm_prfile;
-+
-+ prfile_trace(f, pr, func, line, __func__);
-+ return (f && pr) ? pr : f;
-+}
-+
-+void vmr_do_fput(struct vm_region *region, const char func[], int line)
-+{
-+ struct file *f = region->vm_file, *pr = region->vm_prfile;
-+
-+ prfile_trace(f, pr, func, line, __func__);
-+ fput(f);
-+ if (f && pr)
-+ fput(pr);
-+}
-+#endif /* !CONFIG_MMU */
-aufs4.x-rcN standalone patch
-
-diff --git a/fs/dcache.c b/fs/dcache.c
-index e3719a5..3203470 100644
---- a/fs/dcache.c
-+++ b/fs/dcache.c
-@@ -1305,6 +1305,7 @@ void d_walk(struct dentry *parent, void *data,
- seq = 1;
- goto again;
- }
-+EXPORT_SYMBOL_GPL(d_walk);
-
- struct check_mount {
- struct vfsmount *mnt;
-@@ -2894,6 +2895,7 @@ void d_exchange(struct dentry *dentry1, struct dentry *dentry2)
-
- write_sequnlock(&rename_lock);
- }
-+EXPORT_SYMBOL_GPL(d_exchange);
-
- /**
- * d_ancestor - search for an ancestor
-diff --git a/fs/exec.c b/fs/exec.c
-index 3e14ba2..6818b01 100644
---- a/fs/exec.c
-+++ b/fs/exec.c
-@@ -109,6 +109,7 @@ bool path_noexec(const struct path *path)
- return (path->mnt->mnt_flags & MNT_NOEXEC) ||
- (path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
- }
-+EXPORT_SYMBOL_GPL(path_noexec);
-
- #ifdef CONFIG_USELIB
- /*
-diff --git a/fs/fcntl.c b/fs/fcntl.c
-index f51c2cf..58bf222 100644
---- a/fs/fcntl.c
-+++ b/fs/fcntl.c
-@@ -84,6 +84,7 @@ int setfl(int fd, struct file * filp, unsigned long arg)
- out:
- return error;
- }
-+EXPORT_SYMBOL_GPL(setfl);
-
- 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 61517f5..c6bab39c 100644
---- a/fs/file_table.c
-+++ b/fs/file_table.c
-@@ -148,6 +148,7 @@ struct file *get_empty_filp(void)
- }
- return ERR_PTR(-ENFILE);
- }
-+EXPORT_SYMBOL_GPL(get_empty_filp);
-
- /**
- * alloc_file - allocate and initialize a 'struct file'
-@@ -258,6 +259,7 @@ void flush_delayed_fput(void)
- {
- delayed_fput(NULL);
- }
-+EXPORT_SYMBOL_GPL(flush_delayed_fput);
-
- static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
-
-@@ -300,6 +302,7 @@ void __fput_sync(struct file *file)
- }
-
- EXPORT_SYMBOL(fput);
-+EXPORT_SYMBOL_GPL(__fput_sync);
-
- void put_filp(struct file *file)
- {
-@@ -308,6 +311,7 @@ void put_filp(struct file *file)
- file_free(file);
- }
- }
-+EXPORT_SYMBOL_GPL(put_filp);
-
- void __init files_init(void)
- {
-diff --git a/fs/inode.c b/fs/inode.c
-index f7800d6..f31a6c7 100644
---- a/fs/inode.c
-+++ b/fs/inode.c
-@@ -1664,6 +1664,7 @@ int update_time(struct inode *inode, struct timespec *time, int flags)
-
- return update_time(inode, time, flags);
- }
-+EXPORT_SYMBOL_GPL(update_time);
-
- /**
- * touch_atime - update the access time
-diff --git a/fs/namespace.c b/fs/namespace.c
-index e5a4a7f..6d0c376 100644
---- a/fs/namespace.c
-+++ b/fs/namespace.c
-@@ -517,6 +517,7 @@ void __mnt_drop_write(struct vfsmount *mnt)
- mnt_dec_writers(real_mount(mnt));
- preempt_enable();
- }
-+EXPORT_SYMBOL_GPL(__mnt_drop_write);
-
- /**
- * mnt_drop_write - give up write access to a mount
-@@ -851,6 +852,7 @@ int is_current_mnt_ns(struct vfsmount *mnt)
- {
- return check_mnt(real_mount(mnt));
- }
-+EXPORT_SYMBOL_GPL(is_current_mnt_ns);
-
- /*
- * vfsmount lock must be held for write
-@@ -1887,6 +1889,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
- }
- return 0;
- }
-+EXPORT_SYMBOL_GPL(iterate_mounts);
-
- static void cleanup_group_ids(struct mount *mnt, struct mount *end)
- {
-diff --git a/fs/notify/group.c b/fs/notify/group.c
-index 3235753..14a2d48 100644
---- a/fs/notify/group.c
-+++ b/fs/notify/group.c
-@@ -22,6 +22,7 @@
- #include <linux/srcu.h>
- #include <linux/rculist.h>
- #include <linux/wait.h>
-+#include <linux/module.h>
-
- #include <linux/fsnotify_backend.h>
- #include "fsnotify.h"
-@@ -109,6 +110,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
- {
- atomic_inc(&group->refcnt);
- }
-+EXPORT_SYMBOL_GPL(fsnotify_get_group);
-
- /*
- * Drop a reference to a group. Free it if it's through.
-@@ -118,6 +120,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
- if (atomic_dec_and_test(&group->refcnt))
- fsnotify_final_destroy_group(group);
- }
-+EXPORT_SYMBOL_GPL(fsnotify_put_group);
-
- /*
- * Create a new fsnotify_group and hold a reference for the group returned.
-@@ -147,6 +150,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
-
- return group;
- }
-+EXPORT_SYMBOL_GPL(fsnotify_alloc_group);
-
- int fsnotify_fasync(int fd, struct file *file, int on)
- {
-diff --git a/fs/notify/mark.c b/fs/notify/mark.c
-index 9991f88..117042c 100644
---- a/fs/notify/mark.c
-+++ b/fs/notify/mark.c
-@@ -118,6 +118,7 @@ static bool fsnotify_get_mark_safe(struct fsnotify_mark *mark)
- {
- return atomic_inc_not_zero(&mark->refcnt);
- }
-+EXPORT_SYMBOL_GPL(fsnotify_put_mark);
-
- static void __fsnotify_recalc_mask(struct fsnotify_mark_connector *conn)
- {
-@@ -395,6 +396,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark,
- mutex_unlock(&group->mark_mutex);
- fsnotify_free_mark(mark);
- }
-+EXPORT_SYMBOL_GPL(fsnotify_destroy_mark);
-
- /*
- * Sorting function for lists of fsnotify marks.
-@@ -607,6 +609,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark, struct inode *inode,
- fsnotify_put_mark(mark);
- return ret;
- }
-+EXPORT_SYMBOL_GPL(fsnotify_add_mark);
-
- int fsnotify_add_mark(struct fsnotify_mark *mark, struct inode *inode,
- struct vfsmount *mnt, int allow_dups)
-@@ -742,6 +745,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
- fsnotify_get_group(group);
- mark->group = group;
- }
-+EXPORT_SYMBOL_GPL(fsnotify_init_mark);
-
- /*
- * Destroy all marks in destroy_list, waits for SRCU period to finish before
-diff --git a/fs/open.c b/fs/open.c
-index 7ea1184..6e2e241 100644
---- a/fs/open.c
-+++ b/fs/open.c
-@@ -64,6 +64,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
- inode_unlock(dentry->d_inode);
- return ret;
- }
-+EXPORT_SYMBOL_GPL(do_truncate);
-
- long vfs_truncate(const struct path *path, loff_t length)
- {
-@@ -691,6 +692,7 @@ int open_check_o_direct(struct file *f)
- }
- return 0;
- }
-+EXPORT_SYMBOL_GPL(open_check_o_direct);
-
- static int do_dentry_open(struct file *f,
- struct inode *inode,
-diff --git a/fs/read_write.c b/fs/read_write.c
-index 6aa8c7a..b5d392e 100644
---- a/fs/read_write.c
-+++ b/fs/read_write.c
-@@ -453,6 +453,7 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
-
- 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)
- {
-@@ -493,6 +494,7 @@ vfs_readf_t vfs_readf(struct file *file)
- return new_sync_read;
- return ERR_PTR(-ENOSYS);
- }
-+EXPORT_SYMBOL_GPL(vfs_readf);
-
- vfs_writef_t vfs_writef(struct file *file)
- {
-@@ -504,6 +506,7 @@ vfs_writef_t vfs_writef(struct file *file)
- return new_sync_write;
- return ERR_PTR(-ENOSYS);
- }
-+EXPORT_SYMBOL_GPL(vfs_writef);
-
- ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
- {
-@@ -573,6 +576,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
-
- return ret;
- }
-+EXPORT_SYMBOL_GPL(vfs_write);
-
- static inline loff_t file_pos_read(struct file *file)
- {
-diff --git a/fs/splice.c b/fs/splice.c
-index eb888c6..7ab89d2 100644
---- a/fs/splice.c
-+++ b/fs/splice.c
-@@ -850,6 +850,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-
- return splice_write(pipe, out, ppos, len, flags);
- }
-+EXPORT_SYMBOL_GPL(do_splice_from);
-
- /*
- * Attempt to initiate a splice from a file to a pipe.
-@@ -879,6 +880,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
-
- return 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 eb61780..32c5a05 100644
---- a/fs/sync.c
-+++ b/fs/sync.c
-@@ -38,6 +38,7 @@ int __sync_filesystem(struct super_block *sb, int wait)
- sb->s_op->sync_fs(sb, wait);
- return __sync_blockdev(sb->s_bdev, wait);
- }
-+EXPORT_SYMBOL_GPL(__sync_filesystem);
-
- /*
- * Write out and wait upon all dirty data associated with this
-diff --git a/fs/xattr.c b/fs/xattr.c
-index 61cd28b..35570cd 100644
---- a/fs/xattr.c
-+++ b/fs/xattr.c
-@@ -297,6 +297,7 @@ vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value,
- *xattr_value = value;
- return error;
- }
-+EXPORT_SYMBOL_GPL(vfs_getxattr_alloc);
-
- 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 bc97a97..895a1ba 100644
---- a/kernel/locking/lockdep.c
-+++ b/kernel/locking/lockdep.c
-@@ -155,6 +155,7 @@ inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
- }
- return lock_classes + hlock->class_idx - 1;
- }
-+EXPORT_SYMBOL_GPL(lockdep_hlock_class);
- #define hlock_class(hlock) lockdep_hlock_class(hlock)
-
- #ifdef CONFIG_LOCK_STAT
-diff --git a/kernel/task_work.c b/kernel/task_work.c
-index 836a72a..aa00d49 100644
---- a/kernel/task_work.c
-+++ b/kernel/task_work.c
-@@ -115,3 +115,4 @@ void task_work_run(void)
- } while (work);
- }
- }
-+EXPORT_SYMBOL_GPL(task_work_run);
-diff --git a/security/commoncap.c b/security/commoncap.c
-index fc46f5b..90543ef 100644
---- a/security/commoncap.c
-+++ b/security/commoncap.c
-@@ -1270,12 +1270,14 @@ int cap_mmap_addr(unsigned long addr)
- }
- return ret;
- }
-+EXPORT_SYMBOL_GPL(cap_mmap_addr);
-
- int cap_mmap_file(struct file *file, unsigned long reqprot,
- unsigned long prot, unsigned long flags)
- {
- return 0;
- }
-+EXPORT_SYMBOL_GPL(cap_mmap_file);
-
- #ifdef CONFIG_SECURITY
-
-diff --git a/security/device_cgroup.c b/security/device_cgroup.c
-index 03c1652..f88c84b 100644
---- a/security/device_cgroup.c
-+++ b/security/device_cgroup.c
-@@ -7,6 +7,7 @@
- #include <linux/device_cgroup.h>
- #include <linux/cgroup.h>
- #include <linux/ctype.h>
-+#include <linux/export.h>
- #include <linux/list.h>
- #include <linux/uaccess.h>
- #include <linux/seq_file.h>
-@@ -849,6 +850,7 @@ int __devcgroup_inode_permission(struct inode *inode, int mask)
- return __devcgroup_check_permission(type, imajor(inode), iminor(inode),
- access);
- }
-+EXPORT_SYMBOL_GPL(__devcgroup_inode_permission);
-
- int devcgroup_inode_mknod(int mode, dev_t dev)
- {
-diff --git a/security/security.c b/security/security.c
-index 4bf0f57..b30d1e1 100644
---- a/security/security.c
-+++ b/security/security.c
-@@ -530,6 +530,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
- return 0;
- return call_int_hook(path_rmdir, 0, dir, dentry);
- }
-+EXPORT_SYMBOL_GPL(security_path_rmdir);
-
- int security_path_unlink(const struct path *dir, struct dentry *dentry)
- {
-@@ -546,6 +547,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
- return 0;
- return call_int_hook(path_symlink, 0, dir, dentry, old_name);
- }
-+EXPORT_SYMBOL_GPL(security_path_symlink);
-
- int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
- struct dentry *new_dentry)
-@@ -554,6 +556,7 @@ int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
- return 0;
- return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
- }
-+EXPORT_SYMBOL_GPL(security_path_link);
-
- int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
- const struct path *new_dir, struct dentry *new_dentry,
-@@ -581,6 +584,7 @@ int security_path_truncate(const struct path *path)
- return 0;
- return call_int_hook(path_truncate, 0, path);
- }
-+EXPORT_SYMBOL_GPL(security_path_truncate);
-
- int security_path_chmod(const struct path *path, umode_t mode)
- {
-@@ -588,6 +592,7 @@ int security_path_chmod(const struct path *path, umode_t mode)
- return 0;
- return call_int_hook(path_chmod, 0, path, mode);
- }
-+EXPORT_SYMBOL_GPL(security_path_chmod);
-
- int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
- {
-@@ -595,6 +600,7 @@ int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
- return 0;
- return call_int_hook(path_chown, 0, path, uid, gid);
- }
-+EXPORT_SYMBOL_GPL(security_path_chown);
-
- int security_path_chroot(const struct path *path)
- {
-@@ -680,6 +686,7 @@ int security_inode_readlink(struct dentry *dentry)
- return 0;
- return call_int_hook(inode_readlink, 0, dentry);
- }
-+EXPORT_SYMBOL_GPL(security_inode_readlink);
-
- int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
- bool rcu)
-@@ -695,6 +702,7 @@ int security_inode_permission(struct inode *inode, int mask)
- return 0;
- return call_int_hook(inode_permission, 0, inode, mask);
- }
-+EXPORT_SYMBOL_GPL(security_inode_permission);
-
- int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
- {
-@@ -866,6 +874,7 @@ int security_file_permission(struct file *file, int mask)
-
- return fsnotify_perm(file, mask);
- }
-+EXPORT_SYMBOL_GPL(security_file_permission);
-
- int security_file_alloc(struct file *file)
- {
-@@ -925,6 +934,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
- return ret;
- return ima_file_mmap(file, prot);
- }
-+EXPORT_SYMBOL_GPL(security_mmap_file);
-
- int security_mmap_addr(unsigned long addr)
- {
-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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/ABI/testing/debugfs-aufs linux-4.14/Documentation/ABI/testing/debugfs-aufs
+--- linux-4.14/Documentation/ABI/testing/debugfs-aufs 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/ABI/testing/debugfs-aufs 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,50 @@
+What: /debug/aufs/si_<id>/
+Date: March 2009
@@ -1240,9 +52,9 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/debugfs-aufs linux/Document
+ be created.
+ When the aufs mount option 'noxino' is specified, it
+ 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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/ABI/testing/sysfs-aufs linux-4.14/Documentation/ABI/testing/sysfs-aufs
+--- linux-4.14/Documentation/ABI/testing/sysfs-aufs 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/ABI/testing/sysfs-aufs 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,31 @@
+What: /sys/fs/aufs/si_<id>/
+Date: March 2009
@@ -1275,9 +87,406 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentat
+ even if it is the default path.
+ When the aufs mount option 'noxino' is specified, it
+ 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 2017-11-12 22:24:42.257509799 +0100
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/README linux-4.14/Documentation/filesystems/aufs/README
+--- linux-4.14/Documentation/filesystems/aufs/README 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/README 2021-02-24 21:42:43.441114748 +0100
+@@ -0,0 +1,393 @@
++
++Aufs4 -- advanced multi layered unification filesystem version 4.x
++http://aufs.sf.net
++Junjiro R. Okajima
++
++
++0. Introduction
++----------------------------------------
++In the early days, aufs was entirely re-designed and re-implemented
++Unionfs Version 1.x series. Adding many original ideas, approaches,
++improvements and implementations, it becomes totally different from
++Unionfs while keeping the basic features.
++Recently, Unionfs Version 2.x series begin taking some of the same
++approaches to aufs1's.
++Unionfs is being developed by Professor Erez Zadok at Stony Brook
++University and his team.
++
++Aufs4 supports linux-4.0 and later, and for linux-3.x series try aufs3.
++If you want older kernel version support, try aufs2-2.6.git or
++aufs2-standalone.git repository, aufs1 from CVS on SourceForge.
++
++Note: it becomes clear that "Aufs was rejected. Let's give it up."
++ According to Christoph Hellwig, linux rejects all union-type
++ filesystems but UnionMount.
++<http://marc.info/?l=linux-kernel&m=123938533724484&w=2>
++
++PS. Al Viro seems have a plan to merge aufs as well as overlayfs and
++ UnionMount, and he pointed out an issue around a directory mutex
++ lock and aufs addressed it. But it is still unsure whether aufs will
++ be merged (or any other union solution).
++<http://marc.info/?l=linux-kernel&m=136312705029295&w=1>
++
++
++1. Features
++----------------------------------------
++- unite several directories into a single virtual filesystem. The member
++ directory is called as a branch.
++- you can specify the permission flags to the branch, which are 'readonly',
++ 'readwrite' and 'whiteout-able.'
++- by upper writable branch, internal copyup and whiteout, files/dirs on
++ readonly branch are modifiable logically.
++- dynamic branch manipulation, add, del.
++- etc...
++
++Also there are many enhancements in aufs, such as:
++- test only the highest one for the directory permission (dirperm1)
++- copyup on open (coo=)
++- 'move' policy for copy-up between two writable branches, after
++ checking free space.
++- xattr, acl
++- readdir(3) in userspace.
++- keep inode number by external inode number table
++- keep the timestamps of file/dir in internal copyup operation
++- seekable directory, supporting NFS readdir.
++- whiteout is hardlinked in order to reduce the consumption of inodes
++ on branch
++- do not copyup, nor create a whiteout when it is unnecessary
++- revert a single systemcall when an error occurs in aufs
++- remount interface instead of ioctl
++- maintain /etc/mtab by an external command, /sbin/mount.aufs.
++- loopback mounted filesystem as a branch
++- kernel thread for removing the dir who has a plenty of whiteouts
++- support copyup sparse file (a file which has a 'hole' in it)
++- default permission flags for branches
++- selectable permission flags for ro branch, whether whiteout can
++ exist or not
++- export via NFS.
++- support <sysfs>/fs/aufs and <debugfs>/aufs.
++- support multiple writable branches, some policies to select one
++ among multiple writable branches.
++- a new semantics for link(2) and rename(2) to support multiple
++ writable branches.
++- no glibc changes are required.
++- pseudo hardlink (hardlink over branches)
++- allow a direct access manually to a file on branch, e.g. bypassing aufs.
++ including NFS or remote filesystem branch.
++- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX.
++- and more...
++
++Currently these features are dropped temporary from aufs4.
++See design/08plan.txt in detail.
++- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs
++ (robr)
++- statistics of aufs thread (/sys/fs/aufs/stat)
++
++Features or just an idea in the future (see also design/*.txt),
++- reorder the branch index without del/re-add.
++- permanent xino files for NFSD
++- an option for refreshing the opened files after add/del branches
++- light version, without branch manipulation. (unnecessary?)
++- copyup in userspace
++- inotify in userspace
++- readv/writev
++
++
++2. Download
++----------------------------------------
++There are three GIT trees for aufs4, aufs4-linux.git,
++aufs4-standalone.git, and aufs-util.git. Note that there is no "4" in
++"aufs-util.git."
++While the aufs-util is always necessary, you need either of aufs4-linux
++or aufs4-standalone.
++
++The aufs4-linux tree includes the whole linux mainline GIT tree,
++git://git.kernel.org/.../torvalds/linux.git.
++And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot
++build aufs4 as an external kernel module.
++Several extra patches are not included in this tree. Only
++aufs4-standalone tree contains them. They are described in the later
++section "Configuration and Compilation."
++
++On the other hand, the aufs4-standalone tree has only aufs source files
++and necessary patches, and you can select CONFIG_AUFS_FS=m.
++But you need to apply all aufs patches manually.
++
++You will find GIT branches whose name is in form of "aufs4.x" where "x"
++represents the linux kernel version, "linux-4.x". For instance,
++"aufs4.0" is for linux-4.0. For latest "linux-4.x-rcN", use
++"aufs4.x-rcN" branch.
++
++o aufs4-linux tree
++$ git clone --reference /your/linux/git/tree \
++ git://github.com/sfjro/aufs4-linux.git aufs4-linux.git
++- if you don't have linux GIT tree, then remove "--reference ..."
++$ cd aufs4-linux.git
++$ git checkout origin/aufs4.0
++
++Or You may want to directly git-pull aufs into your linux GIT tree, and
++leave the patch-work to GIT.
++$ cd /your/linux/git/tree
++$ git remote add aufs4 git://github.com/sfjro/aufs4-linux.git
++$ git fetch aufs4
++$ git checkout -b my4.0 v4.0
++$ (add your local change...)
++$ git pull aufs4 aufs4.0
++- now you have v4.0 + your_changes + aufs4.0 in you my4.0 branch.
++- you may need to solve some conflicts between your_changes and
++ aufs4.0. in this case, git-rerere is recommended so that you can
++ solve the similar conflicts automatically when you upgrade to 4.1 or
++ later in the future.
++
++o aufs4-standalone tree
++$ git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git
++$ cd aufs4-standalone.git
++$ git checkout origin/aufs4.0
++
++o aufs-util tree
++$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git
++- note that the public aufs-util.git is on SourceForge instead of
++ GitHUB.
++$ cd aufs-util.git
++$ git checkout origin/aufs4.0
++
++Note: The 4.x-rcN branch is to be used with `rc' kernel versions ONLY.
++The minor version number, 'x' in '4.x', of aufs may not always
++follow the minor version number of the kernel.
++Because changes in the kernel that cause the use of a new
++minor version number do not always require changes to aufs-util.
++
++Since aufs-util has its own minor version number, you may not be
++able to find a GIT branch in aufs-util for your kernel's
++exact minor version number.
++In this case, you should git-checkout the branch for the
++nearest lower number.
++
++For (an unreleased) example:
++If you are using "linux-4.10" and the "aufs4.10" branch
++does not exist in aufs-util repository, then "aufs4.9", "aufs4.8"
++or something numerically smaller is the branch for your kernel.
++
++Also you can view all branches by
++ $ git branch -a
++
++
++3. Configuration and Compilation
++----------------------------------------
++Make sure you have git-checkout'ed the correct branch.
++
++For aufs4-linux tree,
++- enable CONFIG_AUFS_FS.
++- set other aufs configurations if necessary.
++
++For aufs4-standalone tree,
++There are several ways to build.
++
++1.
++- apply ./aufs4-kbuild.patch to your kernel source files.
++- apply ./aufs4-base.patch too.
++- apply ./aufs4-mmap.patch too.
++- apply ./aufs4-standalone.patch too, if you have a plan to set
++ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs4-standalone.patch.
++- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your
++ kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild.
++- enable CONFIG_AUFS_FS, you can select either
++ =m or =y.
++- and build your kernel as usual.
++- install the built kernel.
++ Note: Since linux-3.9, every filesystem module requires an alias
++ "fs-<fsname>". You should make sure that "fs-aufs" is listed in your
++ modules.aliases file if you set CONFIG_AUFS_FS=m.
++- install the header files too by "make headers_install" to the
++ directory where you specify. By default, it is $PWD/usr.
++ "make help" shows a brief note for headers_install.
++- and reboot your system.
++
++2.
++- module only (CONFIG_AUFS_FS=m).
++- apply ./aufs4-base.patch to your kernel source files.
++- apply ./aufs4-mmap.patch too.
++- apply ./aufs4-standalone.patch too.
++- build your kernel, don't forget "make headers_install", and reboot.
++- edit ./config.mk and set other aufs configurations if necessary.
++ Note: You should read $PWD/fs/aufs/Kconfig carefully which describes
++ every aufs configurations.
++- build the module by simple "make".
++ Note: Since linux-3.9, every filesystem module requires an alias
++ "fs-<fsname>". You should make sure that "fs-aufs" is listed in your
++ modules.aliases file.
++- you can specify ${KDIR} make variable which points to your kernel
++ source tree.
++- install the files
++ + run "make install" to install the aufs module, or copy the built
++ $PWD/aufs.ko to /lib/modules/... and run depmod -a (or reboot simply).
++ + run "make install_headers" (instead of headers_install) to install
++ the modified aufs header file (you can specify DESTDIR which is
++ available in aufs standalone version's Makefile only), or copy
++ $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever
++ you like manually. By default, the target directory is $PWD/usr.
++- no need to apply aufs4-kbuild.patch, nor copying source files to your
++ kernel source tree.
++
++Note: The header file aufs_type.h is necessary to build aufs-util
++ as well as "make headers_install" in the kernel source tree.
++ headers_install is subject to be forgotten, but it is essentially
++ necessary, not only for building aufs-util.
++ You may not meet problems without headers_install in some older
++ version though.
++
++And then,
++- read README in aufs-util, build and install it
++- note that your distribution may contain an obsoleted version of
++ aufs_type.h in /usr/include/linux or something. When you build aufs
++ utilities, make sure that your compiler refers the correct aufs header
++ file which is built by "make headers_install."
++- if you want to use readdir(3) in userspace or pathconf(3) wrapper,
++ then run "make install_ulib" too. And refer to the aufs manual in
++ detail.
++
++There several other patches in aufs4-standalone.git. They are all
++optional. When you meet some problems, they will help you.
++- aufs4-loopback.patch
++ Supports a nested loopback mount in a branch-fs. This patch is
++ unnecessary until aufs produces a message like "you may want to try
++ another patch for loopback file".
++- vfs-ino.patch
++ Modifies a system global kernel internal function get_next_ino() in
++ order to stop assigning 0 for an inode-number. Not directly related to
++ aufs, but recommended generally.
++- tmpfs-idr.patch
++ Keeps the tmpfs inode number as the lowest value. Effective to reduce
++ the size of aufs XINO files for tmpfs branch. Also it prevents the
++ duplication of inode number, which is important for backup tools and
++ other utilities. When you find aufs XINO files for tmpfs branch
++ growing too much, try this patch.
++- lockdep-debug.patch
++ Because aufs is not only an ordinary filesystem (callee of VFS), but
++ also a caller of VFS functions for branch filesystems, subclassing of
++ the internal locks for LOCKDEP is necessary. LOCKDEP is a debugging
++ feature of linux kernel. If you enable CONFIG_LOCKDEP, then you will
++ need to apply this debug patch to expand several constant values.
++ If don't know what LOCKDEP, then you don't have apply this patch.
++
++
++4. Usage
++----------------------------------------
++At first, make sure aufs-util are installed, and please read the aufs
++manual, aufs.5 in aufs-util.git tree.
++$ man -l aufs.5
++
++And then,
++$ mkdir /tmp/rw /tmp/aufs
++# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs
++
++Here is another example. The result is equivalent.
++# mount -t aufs -o br=/tmp/rw=rw:${HOME}=ro none /tmp/aufs
++ Or
++# mount -t aufs -o br:/tmp/rw none /tmp/aufs
++# mount -o remount,append:${HOME} /tmp/aufs
++
++Then, you can see whole tree of your home dir through /tmp/aufs. If
++you modify a file under /tmp/aufs, the one on your home directory is
++not affected, instead the same named file will be newly created under
++/tmp/rw. And all of your modification to a file will be applied to
++the one under /tmp/rw. This is called the file based Copy on Write
++(COW) method.
++Aufs mount options are described in aufs.5.
++If you run chroot or something and make your aufs as a root directory,
++then you need to customize the shutdown script. See the aufs manual in
++detail.
++
++Additionally, there are some sample usages of aufs which are a
++diskless system with network booting, and LiveCD over NFS.
++See sample dir in CVS tree on SourceForge.
++
++
++5. Contact
++----------------------------------------
++When you have any problems or strange behaviour in aufs, please let me
++know with:
++- /proc/mounts (instead of the output of mount(8))
++- /sys/module/aufs/*
++- /sys/fs/aufs/* (if you have them)
++- /debug/aufs/* (if you have them)
++- linux kernel version
++ if your kernel is not plain, for example modified by distributor,
++ the url where i can download its source is necessary too.
++- aufs version which was printed at loading the module or booting the
++ system, instead of the date you downloaded.
++- configuration (define/undefine CONFIG_AUFS_xxx)
++- kernel configuration or /proc/config.gz (if you have it)
++- behaviour which you think to be incorrect
++- actual operation, reproducible one is better
++- mailto: aufs-users at lists.sourceforge.net
++
++Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches,
++and Feature Requests) on SourceForge. Please join and write to
++aufs-users ML.
++
++
++6. Acknowledgements
++----------------------------------------
++Thanks to everyone who have tried and are using aufs, whoever
++have reported a bug or any feedback.
++
++Especially donators:
++Tomas Matejicek(slax.org) made a donation (much more than once).
++ Since Apr 2010, Tomas M (the author of Slax and Linux Live
++ scripts) is making "doubling" donations.
++ Unfortunately I cannot list all of the donators, but I really
++ appreciate.
++ It ends Aug 2010, but the ordinary donation URL is still available.
++ <http://sourceforge.net/donate/index.php?group_id=167503>
++Dai Itasaka made a donation (2007/8).
++Chuck Smith made a donation (2008/4, 10 and 12).
++Henk Schoneveld made a donation (2008/9).
++Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10).
++Francois Dupoux made a donation (2008/11).
++Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public
++ aufs2 GIT tree (2009/2).
++William Grant made a donation (2009/3).
++Patrick Lane made a donation (2009/4).
++The Mail Archive (mail-archive.com) made donations (2009/5).
++Nippy Networks (Ed Wildgoose) made a donation (2009/7).
++New Dream Network, LLC (www.dreamhost.com) made a donation (2009/11).
++Pavel Pronskiy made a donation (2011/2).
++Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy
++ Networks (Ed Wildgoose) made a donation for hardware (2011/3).
++Max Lekomcev (DOM-TV project) made a donation (2011/7, 12, 2012/3, 6 and
++11).
++Sam Liddicott made a donation (2011/9).
++Era Scarecrow made a donation (2013/4).
++Bor Ratajc made a donation (2013/4).
++Alessandro Gorreta made a donation (2013/4).
++POIRETTE Marc made a donation (2013/4).
++Alessandro Gorreta made a donation (2013/4).
++lauri kasvandik made a donation (2013/5).
++"pemasu from Finland" made a donation (2013/7).
++The Parted Magic Project made a donation (2013/9 and 11).
++Pavel Barta made a donation (2013/10).
++Nikolay Pertsev made a donation (2014/5).
++James B made a donation (2014/7 and 2015/7).
++Stefano Di Biase made a donation (2014/8).
++Daniel Epellei made a donation (2015/1).
++OmegaPhil made a donation (2016/1).
++Tomasz Szewczyk made a donation (2016/4).
++James Burry made a donation (2016/12).
++
++Thank you very much.
++Donations are always, including future donations, very important and
++helpful for me to keep on developing aufs.
++
++
++7.
++----------------------------------------
++If you are an experienced user, no explanation is needed. Aufs is
++just a linux filesystem.
++
++
++Enjoy!
++
++# Local variables: ;
++# mode: text;
++# End: ;
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/01intro.txt linux-4.14/Documentation/filesystems/aufs/design/01intro.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/01intro.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/01intro.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,171 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -1450,9 +659,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt lin
+Some people may think it is better to pass such work to user space
+helper, instead of doing in kernel space. Actually I am still thinking
+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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/02struct.txt linux-4.14/Documentation/filesystems/aufs/design/02struct.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/02struct.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/02struct.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,258 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -1712,9 +921,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt li
+- etc.
+
+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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/03atomic_open.txt linux-4.14/Documentation/filesystems/aufs/design/03atomic_open.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/03atomic_open.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/03atomic_open.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,85 @@
+
+# Copyright (C) 2015-2017 Junjiro R. Okajima
@@ -1801,9 +1010,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.t
+ ->atomic_open() are lost. in the ordinary case, the checks are
+ done by VFS:do_last(), lookup_open() and atomic_open(). some can
+ 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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/03lookup.txt linux-4.14/Documentation/filesystems/aufs/design/03lookup.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/03lookup.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/03lookup.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,113 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -1918,9 +1127,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt li
+ test, and skip the revalidation in step 4. It is useful and improves
+ aufs performance when system surely hide the aufs branches from user,
+ 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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/04branch.txt linux-4.14/Documentation/filesystems/aufs/design/04branch.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/04branch.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/04branch.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,74 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -1996,9 +1205,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt li
+ - a file on the branch is mmap-ed.
+ - a regular file on the branch is opened for write and there is no
+ 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 2017-07-29 12:14:25.893041746 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/05wbr_policy.txt linux-4.14/Documentation/filesystems/aufs/design/05wbr_policy.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/05wbr_policy.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/05wbr_policy.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,64 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -2064,9 +1273,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.tx
+ where the source and the target exists and selects the higher
+ one. If the selected branch is readonly, then aufs follows the
+ 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 2017-11-12 22:24:44.694244127 +0100
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/06dirren.dot linux-4.14/Documentation/filesystems/aufs/design/06dirren.dot
+--- linux-4.14/Documentation/filesystems/aufs/design/06dirren.dot 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/06dirren.dot 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,31 @@
+
+// to view this graph, run dot(1) command in GRAPHVIZ.
@@ -2099,9 +1308,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot li
+
+aufs_lookup -> whinfo [label="load/remove"];
+}
-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 2017-11-12 22:24:44.694244127 +0100
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/06dirren.txt linux-4.14/Documentation/filesystems/aufs/design/06dirren.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/06dirren.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/06dirren.txt 2021-02-24 21:42:43.437781422 +0100
@@ -0,0 +1,102 @@
+
+# Copyright (C) 2017 Junjiro R. Okajima
@@ -2205,9 +1414,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt li
+contains two names, before- and after-rename, the name comparision in
+UDBA handler may not work correctly. In this case, the behaviour will be
+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 2017-07-29 12:14:25.896375188 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/06fhsm.txt linux-4.14/Documentation/filesystems/aufs/design/06fhsm.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/06fhsm.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/06fhsm.txt 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,120 @@
+
+# Copyright (C) 2011-2017 Junjiro R. Okajima
@@ -2329,9 +1538,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt linu
+
+And of course, in every step, an error may happen. So the operation
+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 2017-07-29 12:14:25.896375188 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/06mmap.txt linux-4.14/Documentation/filesystems/aufs/design/06mmap.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/06mmap.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/06mmap.txt 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,72 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -2405,9 +1614,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt linu
+ equivalent to vm_prfile described above.
+
+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 2017-07-29 12:14:25.896375188 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/06xattr.txt linux-4.14/Documentation/filesystems/aufs/design/06xattr.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/06xattr.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/06xattr.txt 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,96 @@
+
+# Copyright (C) 2014-2017 Junjiro R. Okajima
@@ -2505,9 +1714,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt lin
+Some contradiction may happen I am afraid.
+Do we need another attribute to stop copying XATTR? I am unsure. For
+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 2017-07-29 12:14:25.896375188 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/07export.txt linux-4.14/Documentation/filesystems/aufs/design/07export.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/07export.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/07export.txt 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,58 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -2567,9 +1776,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt li
+ convert it into ESTALE for NFSD.
+- readdir(): call lockdep_on/off() because filldir in NFSD calls
+ 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 2017-07-29 12:14:25.896375188 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/08shwh.txt linux-4.14/Documentation/filesystems/aufs/design/08shwh.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/08shwh.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/08shwh.txt 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,52 @@
+
+# Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -2623,9 +1832,9 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt linu
+
+This new squashfs archive can be stored on the boot device and the
+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 2017-07-29 12:14:25.896375188 +0200
+diff -urNp -x '*.orig' linux-4.14/Documentation/filesystems/aufs/design/10dynop.txt linux-4.14/Documentation/filesystems/aufs/design/10dynop.txt
+--- linux-4.14/Documentation/filesystems/aufs/design/10dynop.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/Documentation/filesystems/aufs/design/10dynop.txt 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,47 @@
+
+# Copyright (C) 2010-2017 Junjiro R. Okajima
@@ -2674,406 +1883,473 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt lin
+XIP (DAX) mainly.
+Currently this approach is applied to address_space_operations for
+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 2017-07-29 12:14:25.893041746 +0200
-@@ -0,0 +1,393 @@
-+
-+Aufs4 -- advanced multi layered unification filesystem version 4.x
-+http://aufs.sf.net
-+Junjiro R. Okajima
-+
-+
-+0. Introduction
-+----------------------------------------
-+In the early days, aufs was entirely re-designed and re-implemented
-+Unionfs Version 1.x series. Adding many original ideas, approaches,
-+improvements and implementations, it becomes totally different from
-+Unionfs while keeping the basic features.
-+Recently, Unionfs Version 2.x series begin taking some of the same
-+approaches to aufs1's.
-+Unionfs is being developed by Professor Erez Zadok at Stony Brook
-+University and his team.
-+
-+Aufs4 supports linux-4.0 and later, and for linux-3.x series try aufs3.
-+If you want older kernel version support, try aufs2-2.6.git or
-+aufs2-standalone.git repository, aufs1 from CVS on SourceForge.
-+
-+Note: it becomes clear that "Aufs was rejected. Let's give it up."
-+ According to Christoph Hellwig, linux rejects all union-type
-+ filesystems but UnionMount.
-+<http://marc.info/?l=linux-kernel&m=123938533724484&w=2>
-+
-+PS. Al Viro seems have a plan to merge aufs as well as overlayfs and
-+ UnionMount, and he pointed out an issue around a directory mutex
-+ lock and aufs addressed it. But it is still unsure whether aufs will
-+ be merged (or any other union solution).
-+<http://marc.info/?l=linux-kernel&m=136312705029295&w=1>
-+
-+
-+1. Features
-+----------------------------------------
-+- unite several directories into a single virtual filesystem. The member
-+ directory is called as a branch.
-+- you can specify the permission flags to the branch, which are 'readonly',
-+ 'readwrite' and 'whiteout-able.'
-+- by upper writable branch, internal copyup and whiteout, files/dirs on
-+ readonly branch are modifiable logically.
-+- dynamic branch manipulation, add, del.
-+- etc...
-+
-+Also there are many enhancements in aufs, such as:
-+- test only the highest one for the directory permission (dirperm1)
-+- copyup on open (coo=)
-+- 'move' policy for copy-up between two writable branches, after
-+ checking free space.
-+- xattr, acl
-+- readdir(3) in userspace.
-+- keep inode number by external inode number table
-+- keep the timestamps of file/dir in internal copyup operation
-+- seekable directory, supporting NFS readdir.
-+- whiteout is hardlinked in order to reduce the consumption of inodes
-+ on branch
-+- do not copyup, nor create a whiteout when it is unnecessary
-+- revert a single systemcall when an error occurs in aufs
-+- remount interface instead of ioctl
-+- maintain /etc/mtab by an external command, /sbin/mount.aufs.
-+- loopback mounted filesystem as a branch
-+- kernel thread for removing the dir who has a plenty of whiteouts
-+- support copyup sparse file (a file which has a 'hole' in it)
-+- default permission flags for branches
-+- selectable permission flags for ro branch, whether whiteout can
-+ exist or not
-+- export via NFS.
-+- support <sysfs>/fs/aufs and <debugfs>/aufs.
-+- support multiple writable branches, some policies to select one
-+ among multiple writable branches.
-+- a new semantics for link(2) and rename(2) to support multiple
-+ writable branches.
-+- no glibc changes are required.
-+- pseudo hardlink (hardlink over branches)
-+- allow a direct access manually to a file on branch, e.g. bypassing aufs.
-+ including NFS or remote filesystem branch.
-+- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX.
-+- and more...
-+
-+Currently these features are dropped temporary from aufs4.
-+See design/08plan.txt in detail.
-+- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs
-+ (robr)
-+- statistics of aufs thread (/sys/fs/aufs/stat)
-+
-+Features or just an idea in the future (see also design/*.txt),
-+- reorder the branch index without del/re-add.
-+- permanent xino files for NFSD
-+- an option for refreshing the opened files after add/del branches
-+- light version, without branch manipulation. (unnecessary?)
-+- copyup in userspace
-+- inotify in userspace
-+- readv/writev
-+
-+
-+2. Download
-+----------------------------------------
-+There are three GIT trees for aufs4, aufs4-linux.git,
-+aufs4-standalone.git, and aufs-util.git. Note that there is no "4" in
-+"aufs-util.git."
-+While the aufs-util is always necessary, you need either of aufs4-linux
-+or aufs4-standalone.
-+
-+The aufs4-linux tree includes the whole linux mainline GIT tree,
-+git://git.kernel.org/.../torvalds/linux.git.
-+And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot
-+build aufs4 as an external kernel module.
-+Several extra patches are not included in this tree. Only
-+aufs4-standalone tree contains them. They are described in the later
-+section "Configuration and Compilation."
-+
-+On the other hand, the aufs4-standalone tree has only aufs source files
-+and necessary patches, and you can select CONFIG_AUFS_FS=m.
-+But you need to apply all aufs patches manually.
-+
-+You will find GIT branches whose name is in form of "aufs4.x" where "x"
-+represents the linux kernel version, "linux-4.x". For instance,
-+"aufs4.0" is for linux-4.0. For latest "linux-4.x-rcN", use
-+"aufs4.x-rcN" branch.
-+
-+o aufs4-linux tree
-+$ git clone --reference /your/linux/git/tree \
-+ git://github.com/sfjro/aufs4-linux.git aufs4-linux.git
-+- if you don't have linux GIT tree, then remove "--reference ..."
-+$ cd aufs4-linux.git
-+$ git checkout origin/aufs4.0
-+
-+Or You may want to directly git-pull aufs into your linux GIT tree, and
-+leave the patch-work to GIT.
-+$ cd /your/linux/git/tree
-+$ git remote add aufs4 git://github.com/sfjro/aufs4-linux.git
-+$ git fetch aufs4
-+$ git checkout -b my4.0 v4.0
-+$ (add your local change...)
-+$ git pull aufs4 aufs4.0
-+- now you have v4.0 + your_changes + aufs4.0 in you my4.0 branch.
-+- you may need to solve some conflicts between your_changes and
-+ aufs4.0. in this case, git-rerere is recommended so that you can
-+ solve the similar conflicts automatically when you upgrade to 4.1 or
-+ later in the future.
-+
-+o aufs4-standalone tree
-+$ git clone git://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git
-+$ cd aufs4-standalone.git
-+$ git checkout origin/aufs4.0
-+
-+o aufs-util tree
-+$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git
-+- note that the public aufs-util.git is on SourceForge instead of
-+ GitHUB.
-+$ cd aufs-util.git
-+$ git checkout origin/aufs4.0
-+
-+Note: The 4.x-rcN branch is to be used with `rc' kernel versions ONLY.
-+The minor version number, 'x' in '4.x', of aufs may not always
-+follow the minor version number of the kernel.
-+Because changes in the kernel that cause the use of a new
-+minor version number do not always require changes to aufs-util.
-+
-+Since aufs-util has its own minor version number, you may not be
-+able to find a GIT branch in aufs-util for your kernel's
-+exact minor version number.
-+In this case, you should git-checkout the branch for the
-+nearest lower number.
-+
-+For (an unreleased) example:
-+If you are using "linux-4.10" and the "aufs4.10" branch
-+does not exist in aufs-util repository, then "aufs4.9", "aufs4.8"
-+or something numerically smaller is the branch for your kernel.
-+
-+Also you can view all branches by
-+ $ git branch -a
+diff -urNp -x '*.orig' linux-4.14/MAINTAINERS linux-4.14/MAINTAINERS
+--- linux-4.14/MAINTAINERS 2021-02-24 21:42:34.681134057 +0100
++++ linux-4.14/MAINTAINERS 2021-02-24 21:42:43.431114768 +0100
+@@ -2465,6 +2465,19 @@ F: include/linux/audit.h
+ F: include/uapi/linux/audit.h
+ F: kernel/audit*
+
++AUFS (advanced multi layered unification filesystem) FILESYSTEM
++M: "J. R. Okajima" <hooanon05g at gmail.com>
++L: linux-unionfs at vger.kernel.org
++L: aufs-users at lists.sourceforge.net (members only)
++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: fs/aufs/
++F: include/uapi/linux/aufs_type.h
+
+ AUXILIARY DISPLAY DRIVERS
+ M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis at gmail.com>
+ W: http://miguelojeda.es/auxdisplay.htm
+diff -urNp -x '*.orig' linux-4.14/drivers/block/loop.c linux-4.14/drivers/block/loop.c
+--- linux-4.14/drivers/block/loop.c 2021-02-24 21:42:34.864466934 +0100
++++ linux-4.14/drivers/block/loop.c 2021-02-24 21:42:43.447781402 +0100
+@@ -605,6 +605,15 @@ static inline void loop_update_dio(struc
+ lo->use_dio);
+ }
+
++static struct file *loop_real_file(struct file *file)
++{
++ struct file *f = NULL;
+
-+3. Configuration and Compilation
-+----------------------------------------
-+Make sure you have git-checkout'ed the correct branch.
++ if (file->f_path.dentry->d_sb->s_op->real_loop)
++ f = file->f_path.dentry->d_sb->s_op->real_loop(file);
++ return f;
++}
+
-+For aufs4-linux tree,
-+- enable CONFIG_AUFS_FS.
-+- set other aufs configurations if necessary.
+ static void loop_reread_partitions(struct loop_device *lo,
+ struct block_device *bdev)
+ {
+@@ -669,6 +678,7 @@ static int loop_change_fd(struct loop_de
+ unsigned int arg)
+ {
+ struct file *file, *old_file;
++ struct file *f, *virt_file = NULL, *old_virt_file;
+ struct inode *inode;
+ int error;
+
+@@ -685,6 +695,12 @@ static int loop_change_fd(struct loop_de
+ file = fget(arg);
+ if (!file)
+ goto out;
++ f = loop_real_file(file);
++ if (f) {
++ virt_file = file;
++ file = f;
++ get_file(file);
++ }
+
+ error = loop_validate_file(file, bdev);
+ if (error)
+@@ -692,6 +708,7 @@ static int loop_change_fd(struct loop_de
+
+ inode = file->f_mapping->host;
+ old_file = lo->lo_backing_file;
++ old_virt_file = lo->lo_backing_virt_file;
+
+ error = -EINVAL;
+
+@@ -703,6 +720,7 @@ static int loop_change_fd(struct loop_de
+ blk_mq_freeze_queue(lo->lo_queue);
+ mapping_set_gfp_mask(old_file->f_mapping, lo->old_gfp_mask);
+ lo->lo_backing_file = file;
++ lo->lo_backing_virt_file = virt_file;
+ 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));
+@@ -710,16 +728,38 @@ static int loop_change_fd(struct loop_de
+ blk_mq_unfreeze_queue(lo->lo_queue);
+
+ fput(old_file);
++ if (old_virt_file)
++ fput(old_virt_file);
+ if (lo->lo_flags & LO_FLAGS_PARTSCAN)
+ loop_reread_partitions(lo, bdev);
+ return 0;
+
+ out_putf:
+ fput(file);
++ if (virt_file)
++ fput(virt_file);
+ out:
+ return error;
+ }
+
++/*
++ * for AUFS
++ * no get/put for file.
++ */
++struct file *loop_backing_file(struct super_block *sb)
++{
++ struct file *ret;
++ struct loop_device *l;
+
-+For aufs4-standalone tree,
-+There are several ways to build.
++ ret = NULL;
++ if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
++ l = sb->s_bdev->bd_disk->private_data;
++ ret = l->lo_backing_file;
++ }
++ return ret;
++}
++EXPORT_SYMBOL_GPL(loop_backing_file);
+
-+1.
-+- apply ./aufs4-kbuild.patch to your kernel source files.
-+- apply ./aufs4-base.patch too.
-+- apply ./aufs4-mmap.patch too.
-+- apply ./aufs4-standalone.patch too, if you have a plan to set
-+ CONFIG_AUFS_FS=m. otherwise you don't need ./aufs4-standalone.patch.
-+- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your
-+ kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild.
-+- enable CONFIG_AUFS_FS, you can select either
-+ =m or =y.
-+- and build your kernel as usual.
-+- install the built kernel.
-+ Note: Since linux-3.9, every filesystem module requires an alias
-+ "fs-<fsname>". You should make sure that "fs-aufs" is listed in your
-+ modules.aliases file if you set CONFIG_AUFS_FS=m.
-+- install the header files too by "make headers_install" to the
-+ directory where you specify. By default, it is $PWD/usr.
-+ "make help" shows a brief note for headers_install.
-+- and reboot your system.
+ /* loop sysfs attributes */
+
+ static ssize_t loop_attr_show(struct device *dev, char *page,
+@@ -885,7 +925,7 @@ static int loop_prepare_queue(struct loo
+ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
+ struct block_device *bdev, unsigned int arg)
+ {
+- struct file *file;
++ struct file *file, *f, *virt_file = NULL;
+ struct inode *inode;
+ struct address_space *mapping;
+ int lo_flags = 0;
+@@ -899,6 +939,12 @@ static int loop_set_fd(struct loop_devic
+ file = fget(arg);
+ if (!file)
+ goto out;
++ f = loop_real_file(file);
++ if (f) {
++ virt_file = file;
++ file = f;
++ get_file(file);
++ }
+
+ error = -EBUSY;
+ if (lo->lo_state != Lo_unbound)
+@@ -931,6 +977,7 @@ static int loop_set_fd(struct loop_devic
+ 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;
+@@ -964,6 +1011,8 @@ static int loop_set_fd(struct loop_devic
+
+ out_putf:
+ fput(file);
++ if (virt_file)
++ fput(virt_file);
+ out:
+ /* This is safe: open() is still holding a reference. */
+ module_put(THIS_MODULE);
+@@ -1010,6 +1059,7 @@ loop_init_xfer(struct loop_device *lo, s
+ static int loop_clr_fd(struct loop_device *lo)
+ {
+ struct file *filp = lo->lo_backing_file;
++ struct file *virt_filp = lo->lo_backing_virt_file;
+ gfp_t gfp = lo->old_gfp_mask;
+ struct block_device *bdev = lo->lo_device;
+
+@@ -1041,6 +1091,7 @@ static int loop_clr_fd(struct loop_devic
+ spin_lock_irq(&lo->lo_lock);
+ lo->lo_state = Lo_rundown;
+ lo->lo_backing_file = NULL;
++ lo->lo_backing_virt_file = NULL;
+ spin_unlock_irq(&lo->lo_lock);
+
+ loop_release_xfer(lo);
+@@ -1088,6 +1139,8 @@ static int loop_clr_fd(struct loop_devic
+ * bd_mutex which is usually taken before lo_ctl_mutex.
+ */
+ fput(filp);
++ if (virt_filp)
++ fput(virt_filp);
+ return 0;
+ }
+
+diff -urNp -x '*.orig' linux-4.14/drivers/block/loop.h linux-4.14/drivers/block/loop.h
+--- linux-4.14/drivers/block/loop.h 2021-02-24 21:42:34.864466934 +0100
++++ linux-4.14/drivers/block/loop.h 2021-02-24 21:42:43.447781402 +0100
+@@ -46,7 +46,7 @@ struct loop_device {
+ int (*ioctl)(struct loop_device *, int cmd,
+ unsigned long arg);
+
+- struct file * lo_backing_file;
++ struct file * lo_backing_file, *lo_backing_virt_file;
+ struct block_device *lo_device;
+ void *key_data;
+
+diff -urNp -x '*.orig' linux-4.14/fs/Kconfig linux-4.14/fs/Kconfig
+--- linux-4.14/fs/Kconfig 2017-11-12 19:46:13.000000000 +0100
++++ linux-4.14/fs/Kconfig 2021-02-24 21:42:43.431114768 +0100
+@@ -248,6 +248,7 @@ source "fs/pstore/Kconfig"
+ source "fs/sysv/Kconfig"
+ source "fs/ufs/Kconfig"
+ source "fs/exofs/Kconfig"
++source "fs/aufs/Kconfig"
+
+ endif # MISC_FILESYSTEMS
+
+diff -urNp -x '*.orig' linux-4.14/fs/Makefile linux-4.14/fs/Makefile
+--- linux-4.14/fs/Makefile 2017-11-12 19:46:13.000000000 +0100
++++ linux-4.14/fs/Makefile 2021-02-24 21:42:43.431114768 +0100
+@@ -129,3 +129,4 @@ obj-y += exofs/ # Multiple modules
+ obj-$(CONFIG_CEPH_FS) += ceph/
+ obj-$(CONFIG_PSTORE) += pstore/
+ obj-$(CONFIG_EFIVAR_FS) += efivarfs/
++obj-$(CONFIG_AUFS_FS) += aufs/
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/Kconfig linux-4.14/fs/aufs/Kconfig
+--- linux-4.14/fs/aufs/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/Kconfig 2021-02-24 21:42:43.444448075 +0100
+@@ -0,0 +1,198 @@
++config AUFS_FS
++ tristate "Aufs (Advanced multi layered unification filesystem) support"
++ help
++ Aufs is a stackable unification filesystem such as Unionfs,
++ which unifies several directories and provides a merged single
++ directory.
++ In the early days, aufs was entirely re-designed and
++ re-implemented Unionfs Version 1.x series. Introducing many
++ original ideas, approaches and improvements, it becomes totally
++ different from Unionfs while keeping the basic features.
+
-+2.
-+- module only (CONFIG_AUFS_FS=m).
-+- apply ./aufs4-base.patch to your kernel source files.
-+- apply ./aufs4-mmap.patch too.
-+- apply ./aufs4-standalone.patch too.
-+- build your kernel, don't forget "make headers_install", and reboot.
-+- edit ./config.mk and set other aufs configurations if necessary.
-+ Note: You should read $PWD/fs/aufs/Kconfig carefully which describes
-+ every aufs configurations.
-+- build the module by simple "make".
-+ Note: Since linux-3.9, every filesystem module requires an alias
-+ "fs-<fsname>". You should make sure that "fs-aufs" is listed in your
-+ modules.aliases file.
-+- you can specify ${KDIR} make variable which points to your kernel
-+ source tree.
-+- install the files
-+ + run "make install" to install the aufs module, or copy the built
-+ $PWD/aufs.ko to /lib/modules/... and run depmod -a (or reboot simply).
-+ + run "make install_headers" (instead of headers_install) to install
-+ the modified aufs header file (you can specify DESTDIR which is
-+ available in aufs standalone version's Makefile only), or copy
-+ $PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever
-+ you like manually. By default, the target directory is $PWD/usr.
-+- no need to apply aufs4-kbuild.patch, nor copying source files to your
-+ kernel source tree.
++if AUFS_FS
++choice
++ prompt "Maximum number of branches"
++ default AUFS_BRANCH_MAX_127
++ help
++ Specifies the maximum number of branches (or member directories)
++ in a single aufs. The larger value consumes more system
++ resources and has a minor impact to performance.
++config AUFS_BRANCH_MAX_127
++ bool "127"
++ help
++ Specifies the maximum number of branches (or member directories)
++ in a single aufs. The larger value consumes more system
++ resources and has a minor impact to performance.
++config AUFS_BRANCH_MAX_511
++ bool "511"
++ help
++ Specifies the maximum number of branches (or member directories)
++ in a single aufs. The larger value consumes more system
++ resources and has a minor impact to performance.
++config AUFS_BRANCH_MAX_1023
++ bool "1023"
++ help
++ Specifies the maximum number of branches (or member directories)
++ in a single aufs. The larger value consumes more system
++ resources and has a minor impact to performance.
++config AUFS_BRANCH_MAX_32767
++ bool "32767"
++ help
++ Specifies the maximum number of branches (or member directories)
++ in a single aufs. The larger value consumes more system
++ resources and has a minor impact to performance.
++endchoice
+
-+Note: The header file aufs_type.h is necessary to build aufs-util
-+ as well as "make headers_install" in the kernel source tree.
-+ headers_install is subject to be forgotten, but it is essentially
-+ necessary, not only for building aufs-util.
-+ You may not meet problems without headers_install in some older
-+ version though.
++config AUFS_SBILIST
++ bool
++ depends on AUFS_MAGIC_SYSRQ || PROC_FS
++ default y
++ help
++ Automatic configuration for internal use.
++ When aufs supports Magic SysRq or /proc, enabled automatically.
+
-+And then,
-+- read README in aufs-util, build and install it
-+- note that your distribution may contain an obsoleted version of
-+ aufs_type.h in /usr/include/linux or something. When you build aufs
-+ utilities, make sure that your compiler refers the correct aufs header
-+ file which is built by "make headers_install."
-+- if you want to use readdir(3) in userspace or pathconf(3) wrapper,
-+ then run "make install_ulib" too. And refer to the aufs manual in
-+ detail.
++config AUFS_HNOTIFY
++ bool "Detect direct branch access (bypassing aufs)"
++ help
++ If you want to modify files on branches directly, eg. bypassing aufs,
++ and want aufs to detect the changes of them fully, then enable this
++ option and use 'udba=notify' mount option.
++ Currently there is only one available configuration, "fsnotify".
++ It will have a negative impact to the performance.
++ See detail in aufs.5.
+
-+There several other patches in aufs4-standalone.git. They are all
-+optional. When you meet some problems, they will help you.
-+- aufs4-loopback.patch
-+ Supports a nested loopback mount in a branch-fs. This patch is
-+ unnecessary until aufs produces a message like "you may want to try
-+ another patch for loopback file".
-+- vfs-ino.patch
-+ Modifies a system global kernel internal function get_next_ino() in
-+ order to stop assigning 0 for an inode-number. Not directly related to
-+ aufs, but recommended generally.
-+- tmpfs-idr.patch
-+ Keeps the tmpfs inode number as the lowest value. Effective to reduce
-+ the size of aufs XINO files for tmpfs branch. Also it prevents the
-+ duplication of inode number, which is important for backup tools and
-+ other utilities. When you find aufs XINO files for tmpfs branch
-+ growing too much, try this patch.
-+- lockdep-debug.patch
-+ Because aufs is not only an ordinary filesystem (callee of VFS), but
-+ also a caller of VFS functions for branch filesystems, subclassing of
-+ the internal locks for LOCKDEP is necessary. LOCKDEP is a debugging
-+ feature of linux kernel. If you enable CONFIG_LOCKDEP, then you will
-+ need to apply this debug patch to expand several constant values.
-+ If don't know what LOCKDEP, then you don't have apply this patch.
++choice
++ prompt "method" if AUFS_HNOTIFY
++ default AUFS_HFSNOTIFY
++config AUFS_HFSNOTIFY
++ bool "fsnotify"
++ select FSNOTIFY
++endchoice
+
++config AUFS_EXPORT
++ bool "NFS-exportable aufs"
++ depends on EXPORTFS
++ help
++ If you want to export your mounted aufs via NFS, then enable this
++ option. There are several requirements for this configuration.
++ See detail in aufs.5.
+
-+4. Usage
-+----------------------------------------
-+At first, make sure aufs-util are installed, and please read the aufs
-+manual, aufs.5 in aufs-util.git tree.
-+$ man -l aufs.5
++config AUFS_INO_T_64
++ bool
++ depends on AUFS_EXPORT
++ depends on 64BIT && !(ALPHA || S390)
++ default y
++ help
++ Automatic configuration for internal use.
++ /* typedef unsigned long/int __kernel_ino_t */
++ /* alpha and s390x are int */
+
-+And then,
-+$ mkdir /tmp/rw /tmp/aufs
-+# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs
++config AUFS_XATTR
++ bool "support for XATTR/EA (including Security Labels)"
++ help
++ If your branch fs supports XATTR/EA and you want to make them
++ available in aufs too, then enable this opsion and specify the
++ branch attributes for EA.
++ See detail in aufs.5.
+
-+Here is another example. The result is equivalent.
-+# mount -t aufs -o br=/tmp/rw=rw:${HOME}=ro none /tmp/aufs
-+ Or
-+# mount -t aufs -o br:/tmp/rw none /tmp/aufs
-+# mount -o remount,append:${HOME} /tmp/aufs
++config AUFS_FHSM
++ bool "File-based Hierarchical Storage Management"
++ help
++ Hierarchical Storage Management (or HSM) is a well-known feature
++ in the storage world. Aufs provides this feature as file-based.
++ with multiple branches.
++ These multiple branches are prioritized, ie. the topmost one
++ should be the fastest drive and be used heavily.
+
-+Then, you can see whole tree of your home dir through /tmp/aufs. If
-+you modify a file under /tmp/aufs, the one on your home directory is
-+not affected, instead the same named file will be newly created under
-+/tmp/rw. And all of your modification to a file will be applied to
-+the one under /tmp/rw. This is called the file based Copy on Write
-+(COW) method.
-+Aufs mount options are described in aufs.5.
-+If you run chroot or something and make your aufs as a root directory,
-+then you need to customize the shutdown script. See the aufs manual in
-+detail.
++config AUFS_RDU
++ bool "Readdir in userspace"
++ help
++ Aufs has two methods to provide a merged view for a directory,
++ by a user-space library and by kernel-space natively. The latter
++ is always enabled but sometimes large and slow.
++ If you enable this option, install the library in aufs2-util
++ package, and set some environment variables for your readdir(3),
++ then the work will be handled in user-space which generally
++ shows better performance in most cases.
++ See detail in aufs.5.
+
-+Additionally, there are some sample usages of aufs which are a
-+diskless system with network booting, and LiveCD over NFS.
-+See sample dir in CVS tree on SourceForge.
++config AUFS_DIRREN
++ bool "Workaround for rename(2)-ing a directory"
++ help
++ By default, aufs returns EXDEV error in renameing a dir who has
++ his child on the lower branch, since it is a bad idea to issue
++ rename(2) internally for every lower branch. But user may not
++ accept this behaviour. So here is a workaround to allow such
++ rename(2) and store some extra infromation on the writable
++ branch. Obviously this costs high (and I don't like it).
++ To use this feature, you need to enable this configuration AND
++ to specify the mount option `dirren.'
++ See details in aufs.5 and the design documents.
+
++config AUFS_SHWH
++ bool "Show whiteouts"
++ help
++ If you want to make the whiteouts in aufs visible, then enable
++ this option and specify 'shwh' mount option. Although it may
++ sounds like philosophy or something, but in technically it
++ simply shows the name of whiteout with keeping its behaviour.
+
-+5. Contact
-+----------------------------------------
-+When you have any problems or strange behaviour in aufs, please let me
-+know with:
-+- /proc/mounts (instead of the output of mount(8))
-+- /sys/module/aufs/*
-+- /sys/fs/aufs/* (if you have them)
-+- /debug/aufs/* (if you have them)
-+- linux kernel version
-+ if your kernel is not plain, for example modified by distributor,
-+ the url where i can download its source is necessary too.
-+- aufs version which was printed at loading the module or booting the
-+ system, instead of the date you downloaded.
-+- configuration (define/undefine CONFIG_AUFS_xxx)
-+- kernel configuration or /proc/config.gz (if you have it)
-+- behaviour which you think to be incorrect
-+- actual operation, reproducible one is better
-+- mailto: aufs-users at lists.sourceforge.net
++config AUFS_BR_RAMFS
++ bool "Ramfs (initramfs/rootfs) as an aufs branch"
++ help
++ If you want to use ramfs as an aufs branch fs, then enable this
++ option. Generally tmpfs is recommended.
++ Aufs prohibited them to be a branch fs by default, because
++ initramfs becomes unusable after switch_root or something
++ generally. If you sets initramfs as an aufs branch and boot your
++ system by switch_root, you will meet a problem easily since the
++ files in initramfs may be inaccessible.
++ Unless you are going to use ramfs as an aufs branch fs without
++ switch_root or something, leave it N.
+
-+Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches,
-+and Feature Requests) on SourceForge. Please join and write to
-+aufs-users ML.
++config AUFS_BR_FUSE
++ bool "Fuse fs as an aufs branch"
++ depends on FUSE_FS
++ select AUFS_POLL
++ help
++ If you want to use fuse-based userspace filesystem as an aufs
++ branch fs, then enable this option.
++ It implements the internal poll(2) operation which is
++ implemented by fuse only (curretnly).
+
++config AUFS_POLL
++ bool
++ help
++ Automatic configuration for internal use.
+
-+6. Acknowledgements
-+----------------------------------------
-+Thanks to everyone who have tried and are using aufs, whoever
-+have reported a bug or any feedback.
++config AUFS_BR_HFSPLUS
++ bool "Hfsplus as an aufs branch"
++ depends on HFSPLUS_FS
++ default y
++ help
++ If you want to use hfsplus fs as an aufs branch fs, then enable
++ this option. This option introduces a small overhead at
++ copying-up a file on hfsplus.
+
-+Especially donators:
-+Tomas Matejicek(slax.org) made a donation (much more than once).
-+ Since Apr 2010, Tomas M (the author of Slax and Linux Live
-+ scripts) is making "doubling" donations.
-+ Unfortunately I cannot list all of the donators, but I really
-+ appreciate.
-+ It ends Aug 2010, but the ordinary donation URL is still available.
-+ <http://sourceforge.net/donate/index.php?group_id=167503>
-+Dai Itasaka made a donation (2007/8).
-+Chuck Smith made a donation (2008/4, 10 and 12).
-+Henk Schoneveld made a donation (2008/9).
-+Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10).
-+Francois Dupoux made a donation (2008/11).
-+Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public
-+ aufs2 GIT tree (2009/2).
-+William Grant made a donation (2009/3).
-+Patrick Lane made a donation (2009/4).
-+The Mail Archive (mail-archive.com) made donations (2009/5).
-+Nippy Networks (Ed Wildgoose) made a donation (2009/7).
-+New Dream Network, LLC (www.dreamhost.com) made a donation (2009/11).
-+Pavel Pronskiy made a donation (2011/2).
-+Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy
-+ Networks (Ed Wildgoose) made a donation for hardware (2011/3).
-+Max Lekomcev (DOM-TV project) made a donation (2011/7, 12, 2012/3, 6 and
-+11).
-+Sam Liddicott made a donation (2011/9).
-+Era Scarecrow made a donation (2013/4).
-+Bor Ratajc made a donation (2013/4).
-+Alessandro Gorreta made a donation (2013/4).
-+POIRETTE Marc made a donation (2013/4).
-+Alessandro Gorreta made a donation (2013/4).
-+lauri kasvandik made a donation (2013/5).
-+"pemasu from Finland" made a donation (2013/7).
-+The Parted Magic Project made a donation (2013/9 and 11).
-+Pavel Barta made a donation (2013/10).
-+Nikolay Pertsev made a donation (2014/5).
-+James B made a donation (2014/7 and 2015/7).
-+Stefano Di Biase made a donation (2014/8).
-+Daniel Epellei made a donation (2015/1).
-+OmegaPhil made a donation (2016/1).
-+Tomasz Szewczyk made a donation (2016/4).
-+James Burry made a donation (2016/12).
++config AUFS_BDEV_LOOP
++ bool
++ depends on BLK_DEV_LOOP
++ default y
++ help
++ Automatic configuration for internal use.
++ Convert =[ym] into =y.
+
-+Thank you very much.
-+Donations are always, including future donations, very important and
-+helpful for me to keep on developing aufs.
++config AUFS_DEBUG
++ bool "Debug aufs"
++ help
++ Enable this to compile aufs internal debug code.
++ It will have a negative impact to the performance.
+
++config AUFS_MAGIC_SYSRQ
++ bool
++ depends on AUFS_DEBUG && MAGIC_SYSRQ
++ default y
++ help
++ Automatic configuration for internal use.
++ When aufs supports Magic SysRq, enabled automatically.
++endif
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/Makefile linux-4.14/fs/aufs/Makefile
+--- linux-4.14/fs/aufs/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/Makefile 2021-02-24 21:42:43.444448075 +0100
+@@ -0,0 +1,45 @@
+
-+7.
-+----------------------------------------
-+If you are an experienced user, no explanation is needed. Aufs is
-+just a linux filesystem.
++include ${src}/magic.mk
++ifeq (${CONFIG_AUFS_FS},m)
++include ${src}/conf.mk
++endif
++-include ${src}/priv_def.mk
+
++# cf. include/linux/kernel.h
++# enable pr_debug
++ccflags-y += -DDEBUG
++# sparse requires the full pathname
++ifdef M
++ccflags-y += -include ${M}/../../include/uapi/linux/aufs_type.h
++else
++ccflags-y += -include ${srctree}/include/uapi/linux/aufs_type.h
++endif
+
-+Enjoy!
++obj-$(CONFIG_AUFS_FS) += aufs.o
++aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \
++ wkq.o vfsub.o dcsub.o \
++ cpup.o whout.o wbr_policy.o \
++ dinfo.o dentry.o \
++ dynop.o \
++ finfo.o file.o f_op.o \
++ dir.o vdir.o \
++ iinfo.o inode.o i_op.o i_op_add.o i_op_del.o i_op_ren.o \
++ mvdown.o ioctl.o
+
-+# Local variables: ;
-+# mode: text;
-+# 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 2017-11-12 22:24:44.697577553 +0100
++# all are boolean
++aufs-$(CONFIG_PROC_FS) += procfs.o plink.o
++aufs-$(CONFIG_SYSFS) += sysfs.o
++aufs-$(CONFIG_DEBUG_FS) += dbgaufs.o
++aufs-$(CONFIG_AUFS_BDEV_LOOP) += loop.o
++aufs-$(CONFIG_AUFS_HNOTIFY) += hnotify.o
++aufs-$(CONFIG_AUFS_HFSNOTIFY) += hfsnotify.o
++aufs-$(CONFIG_AUFS_EXPORT) += export.o
++aufs-$(CONFIG_AUFS_XATTR) += xattr.o
++aufs-$(CONFIG_FS_POSIX_ACL) += posix_acl.o
++aufs-$(CONFIG_AUFS_DIRREN) += dirren.o
++aufs-$(CONFIG_AUFS_FHSM) += fhsm.o
++aufs-$(CONFIG_AUFS_POLL) += poll.o
++aufs-$(CONFIG_AUFS_RDU) += rdu.o
++aufs-$(CONFIG_AUFS_BR_HFSPLUS) += hfsplus.o
++aufs-$(CONFIG_AUFS_DEBUG) += debug.o
++aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/aufs.h linux-4.14/fs/aufs/aufs.h
+--- linux-4.14/fs/aufs/aufs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/aufs.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -3135,9 +2411,9 @@ diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:44.697577553 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/branch.c linux-4.14/fs/aufs/branch.c
+--- linux-4.14/fs/aufs/branch.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/branch.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,1432 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -4571,9 +3847,9 @@ diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
+
+ return err;
+}
-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 2017-11-12 22:24:44.697577553 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/branch.h linux-4.14/fs/aufs/branch.h
+--- linux-4.14/fs/aufs/branch.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/branch.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,333 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -4908,9 +4184,9 @@ diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/conf.mk linux-4.14/fs/aufs/conf.mk
+--- linux-4.14/fs/aufs/conf.mk 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/conf.mk 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,39 @@
+
+AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS}
@@ -4951,9 +4227,9 @@ diff -urN /usr/share/empty/fs/aufs/conf.mk linux/fs/aufs/conf.mk
+${obj}/sysfs.o: ${AuConfName}
+
+-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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/cpup.c linux-4.14/fs/aufs/cpup.c
+--- linux-4.14/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/cpup.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,1443 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -6398,9 +5674,9 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
+ dput(parent);
+ return err;
+}
-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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/cpup.h linux-4.14/fs/aufs/cpup.h
+--- linux-4.14/fs/aufs/cpup.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/cpup.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -6501,9 +5777,9 @@ diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dbgaufs.c linux-4.14/fs/aufs/dbgaufs.c
+--- linux-4.14/fs/aufs/dbgaufs.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dbgaufs.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,437 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -6942,9 +6218,9 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
+ err = 0;
+ return err;
+}
-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 2017-07-29 12:14:25.899708630 +0200
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dbgaufs.h linux-4.14/fs/aufs/dbgaufs.h
+--- linux-4.14/fs/aufs/dbgaufs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dbgaufs.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -6994,9 +6270,9 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:42.267510077 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dcsub.c linux-4.14/fs/aufs/dcsub.c
+--- linux-4.14/fs/aufs/dcsub.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dcsub.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -7223,9 +6499,9 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
+
+ return path_is_under(path + 0, path + 1);
+}
-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 2017-07-29 12:14:25.899708630 +0200
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dcsub.h linux-4.14/fs/aufs/dcsub.h
+--- linux-4.14/fs/aufs/dcsub.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dcsub.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -7363,9 +6639,9 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:42.267510077 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/debug.c linux-4.14/fs/aufs/debug.c
+--- linux-4.14/fs/aufs/debug.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/debug.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,440 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -7807,9 +7083,9 @@ diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
+
+ return 0;
+}
-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 2017-07-29 12:14:25.899708630 +0200
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/debug.h linux-4.14/fs/aufs/debug.h
+--- linux-4.14/fs/aufs/debug.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/debug.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -8036,9 +7312,9 @@ diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dentry.c linux-4.14/fs/aufs/dentry.c
+--- linux-4.14/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dentry.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,1152 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -9192,9 +8468,9 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
+const struct dentry_operations aufs_dop_noreval = {
+ .d_release = aufs_d_release
+};
-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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dentry.h linux-4.14/fs/aufs/dentry.h
+--- linux-4.14/fs/aufs/dentry.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dentry.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -9462,9 +8738,9 @@ diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:42.267510077 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dinfo.c linux-4.14/fs/aufs/dinfo.c
+--- linux-4.14/fs/aufs/dinfo.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dinfo.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,553 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -10019,9 +9295,9 @@ diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
+ return bindex;
+ return -1;
+}
-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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dir.c linux-4.14/fs/aufs/dir.c
+--- linux-4.14/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dir.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,759 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -10782,9 +10058,9 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
+ .flush = aufs_flush_dir,
+ .fsync = aufs_fsync_dir
+};
-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 2017-11-12 22:24:42.267510077 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dir.h linux-4.14/fs/aufs/dir.h
+--- linux-4.14/fs/aufs/dir.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dir.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -10917,9 +10193,9 @@ diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dirren.c linux-4.14/fs/aufs/dirren.c
+--- linux-4.14/fs/aufs/dirren.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dirren.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,1315 @@
+/*
+ * Copyright (C) 2017 Junjiro R. Okajima
@@ -12236,9 +11512,9 @@ diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
+out:
+ return err;
+}
-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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dirren.h linux-4.14/fs/aufs/dirren.h
+--- linux-4.14/fs/aufs/dirren.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dirren.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2017 Junjiro R. Okajima
@@ -12379,9 +11655,9 @@ diff -urN /usr/share/empty/fs/aufs/dirren.h linux/fs/aufs/dirren.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dynop.c linux-4.14/fs/aufs/dynop.c
+--- linux-4.14/fs/aufs/dynop.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dynop.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,369 @@
+/*
+ * Copyright (C) 2010-2017 Junjiro R. Okajima
@@ -12752,9 +12028,9 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
+ for (i = 0; i < AuDyLast; i++)
+ WARN_ON(!hlist_bl_empty(dynop + i));
+}
-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 2017-11-12 22:24:44.704244405 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/dynop.h linux-4.14/fs/aufs/dynop.h
+--- linux-4.14/fs/aufs/dynop.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/dynop.h 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010-2017 Junjiro R. Okajima
@@ -12830,9 +12106,9 @@ diff -urN /usr/share/empty/fs/aufs/dynop.h linux/fs/aufs/dynop.h
+
+#endif /* __KERNEL__ */
+#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 2017-11-12 22:24:42.267510077 +0100
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/export.c linux-4.14/fs/aufs/export.c
+--- linux-4.14/fs/aufs/export.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/export.c 2021-02-24 21:42:43.441114748 +0100
@@ -0,0 +1,836 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
@@ -13438,672 +12714,242 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
+ /* branch id may be wrapped around */
+ br = NULL;
+ if (unlikely(si_nfsd_read_lock(sb, &nsi_lock)))
-+ goto out;
-+ nsi_lock.force_lock = 1;
-+
-+ /* is this inode still cached? */
-+ ino = decode_ino(fh + Fh_ino);
-+ /* it should never happen */
-+ if (unlikely(ino == AUFS_ROOT_INO))
-+ goto out_unlock;
-+
-+ dir_ino = decode_ino(fh + Fh_dir_ino);
-+ dentry = decode_by_ino(sb, ino, dir_ino);
-+ if (IS_ERR(dentry))
-+ goto out_unlock;
-+ if (dentry)
-+ goto accept;
-+
-+ /* is the parent dir cached? */
-+ br = au_sbr(sb, nsi_lock.bindex);
-+ au_br_get(br);
-+ dentry = decode_by_dir_ino(sb, ino, dir_ino, &nsi_lock);
-+ if (IS_ERR(dentry))
-+ goto out_unlock;
-+ if (dentry)
-+ goto accept;
-+
-+ /* lookup path */
-+ dentry = decode_by_path(sb, ino, fh, fh_len, &nsi_lock);
-+ if (IS_ERR(dentry))
-+ goto out_unlock;
-+ if (unlikely(!dentry))
-+ /* todo?: make it ESTALE */
-+ goto out_unlock;
-+
-+accept:
-+ if (!au_digen_test(dentry, au_sigen(sb))
-+ && d_inode(dentry)->i_generation == fh[Fh_igen])
-+ goto out_unlock; /* success */
-+
-+ dput(dentry);
-+ dentry = ERR_PTR(-ESTALE);
-+out_unlock:
-+ if (br)
-+ au_br_put(br);
-+ si_read_unlock(sb);
-+out:
-+ AuTraceErrPtr(dentry);
-+ return dentry;
-+}
-+
-+#if 0 /* reserved for future use */
-+/* support subtreecheck option */
-+static struct dentry *aufs_fh_to_parent(struct super_block *sb, struct fid *fid,
-+ int fh_len, int fh_type)
-+{
-+ struct dentry *parent;
-+ __u32 *fh = fid->raw;
-+ ino_t dir_ino;
-+
-+ dir_ino = decode_ino(fh + Fh_dir_ino);
-+ parent = decode_by_ino(sb, dir_ino, 0);
-+ if (IS_ERR(parent))
-+ goto out;
-+ if (!parent)
-+ parent = decode_by_path(sb, au_br_index(sb, fh[Fh_br_id]),
-+ dir_ino, fh, fh_len);
-+
-+out:
-+ AuTraceErrPtr(parent);
-+ return parent;
-+}
-+#endif
-+
-+/* ---------------------------------------------------------------------- */
-+
-+static int aufs_encode_fh(struct inode *inode, __u32 *fh, int *max_len,
-+ struct inode *dir)
-+{
-+ int err;
-+ aufs_bindex_t bindex;
-+ struct super_block *sb, *h_sb;
-+ struct dentry *dentry, *parent, *h_parent;
-+ struct inode *h_dir;
-+ struct au_branch *br;
-+
-+ err = -ENOSPC;
-+ if (unlikely(*max_len <= Fh_tail)) {
-+ AuWarn1("NFSv2 client (max_len %d)?\n", *max_len);
-+ goto out;
-+ }
-+
-+ err = FILEID_ROOT;
-+ if (inode->i_ino == AUFS_ROOT_INO) {
-+ AuDebugOn(inode->i_ino != AUFS_ROOT_INO);
-+ goto out;
-+ }
-+
-+ h_parent = NULL;
-+ sb = inode->i_sb;
-+ err = si_read_lock(sb, AuLock_FLUSH);
-+ if (unlikely(err))
-+ goto out;
-+
-+#ifdef CONFIG_AUFS_DEBUG
-+ if (unlikely(!au_opt_test(au_mntflags(sb), XINO)))
-+ AuWarn1("NFS-exporting requires xino\n");
-+#endif
-+ err = -EIO;
-+ parent = NULL;
-+ ii_read_lock_child(inode);
-+ bindex = au_ibtop(inode);
-+ if (!dir) {
-+ dentry = d_find_any_alias(inode);
-+ if (unlikely(!dentry))
-+ goto out_unlock;
-+ AuDebugOn(au_test_anon(dentry));
-+ parent = dget_parent(dentry);
-+ dput(dentry);
-+ if (unlikely(!parent))
-+ goto out_unlock;
-+ if (d_really_is_positive(parent))
-+ dir = d_inode(parent);
-+ }
-+
-+ ii_read_lock_parent(dir);
-+ h_dir = au_h_iptr(dir, bindex);
-+ ii_read_unlock(dir);
-+ if (unlikely(!h_dir))
-+ goto out_parent;
-+ h_parent = d_find_any_alias(h_dir);
-+ if (unlikely(!h_parent))
-+ goto out_hparent;
-+
-+ err = -EPERM;
-+ br = au_sbr(sb, bindex);
-+ h_sb = au_br_sb(br);
-+ if (unlikely(!h_sb->s_export_op)) {
-+ AuErr1("%s branch is not exportable\n", au_sbtype(h_sb));
-+ goto out_hparent;
-+ }
-+
-+ fh[Fh_br_id] = br->br_id;
-+ fh[Fh_sigen] = au_sigen(sb);
-+ encode_ino(fh + Fh_ino, inode->i_ino);
-+ encode_ino(fh + Fh_dir_ino, dir->i_ino);
-+ fh[Fh_igen] = inode->i_generation;
-+
-+ *max_len -= Fh_tail;
-+ fh[Fh_h_type] = exportfs_encode_fh(h_parent, (void *)(fh + Fh_tail),
-+ max_len,
-+ /*connectable or subtreecheck*/0);
-+ err = fh[Fh_h_type];
-+ *max_len += Fh_tail;
-+ /* todo: macros? */
-+ if (err != FILEID_INVALID)
-+ err = 99;
-+ else
-+ AuWarn1("%s encode_fh failed\n", au_sbtype(h_sb));
-+
-+out_hparent:
-+ dput(h_parent);
-+out_parent:
-+ dput(parent);
-+out_unlock:
-+ ii_read_unlock(inode);
-+ si_read_unlock(sb);
-+out:
-+ if (unlikely(err < 0))
-+ err = FILEID_INVALID;
-+ return err;
-+}
-+
-+/* ---------------------------------------------------------------------- */
-+
-+static int aufs_commit_metadata(struct inode *inode)
-+{
-+ int err;
-+ aufs_bindex_t bindex;
-+ struct super_block *sb;
-+ struct inode *h_inode;
-+ int (*f)(struct inode *inode);
-+
-+ sb = inode->i_sb;
-+ si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
-+ ii_write_lock_child(inode);
-+ bindex = au_ibtop(inode);
-+ AuDebugOn(bindex < 0);
-+ h_inode = au_h_iptr(inode, bindex);
-+
-+ f = h_inode->i_sb->s_export_op->commit_metadata;
-+ if (f)
-+ err = f(h_inode);
-+ else {
-+ struct writeback_control wbc = {
-+ .sync_mode = WB_SYNC_ALL,
-+ .nr_to_write = 0 /* metadata only */
-+ };
-+
-+ err = sync_inode(h_inode, &wbc);
-+ }
-+
-+ au_cpup_attr_timesizes(inode);
-+ ii_write_unlock(inode);
-+ si_read_unlock(sb);
-+ return err;
-+}
-+
-+/* ---------------------------------------------------------------------- */
-+
-+static struct export_operations aufs_export_op = {
-+ .fh_to_dentry = aufs_fh_to_dentry,
-+ /* .fh_to_parent = aufs_fh_to_parent, */
-+ .encode_fh = aufs_encode_fh,
-+ .commit_metadata = aufs_commit_metadata
-+};
-+
-+void au_export_init(struct super_block *sb)
-+{
-+ struct au_sbinfo *sbinfo;
-+ __u32 u;
-+
-+ BUILD_BUG_ON_MSG(IS_BUILTIN(CONFIG_AUFS_FS)
-+ && IS_MODULE(CONFIG_EXPORTFS),
-+ AUFS_NAME ": unsupported configuration "
-+ "CONFIG_EXPORTFS=m and CONFIG_AUFS_FS=y");
-+
-+ sb->s_export_op = &aufs_export_op;
-+ sbinfo = au_sbi(sb);
-+ sbinfo->si_xigen = NULL;
-+ get_random_bytes(&u, sizeof(u));
-+ BUILD_BUG_ON(sizeof(u) != sizeof(int));
-+ atomic_set(&sbinfo->si_xigen_next, u);
-+}
-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 2017-07-29 12:14:25.903042072 +0200
-@@ -0,0 +1,426 @@
-+/*
-+ * Copyright (C) 2011-2017 Junjiro R. Okajima
-+ *
-+ * This program, aufs is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ */
-+
-+/*
-+ * File-based Hierarchy Storage Management
-+ */
-+
-+#include <linux/anon_inodes.h>
-+#include <linux/poll.h>
-+#include <linux/seq_file.h>
-+#include <linux/statfs.h>
-+#include "aufs.h"
-+
-+static aufs_bindex_t au_fhsm_bottom(struct super_block *sb)
-+{
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
-+
-+ SiMustAnyLock(sb);
-+
-+ sbinfo = au_sbi(sb);
-+ fhsm = &sbinfo->si_fhsm;
-+ AuDebugOn(!fhsm);
-+ return fhsm->fhsm_bottom;
-+}
-+
-+void au_fhsm_set_bottom(struct super_block *sb, aufs_bindex_t bindex)
-+{
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
-+
-+ SiMustWriteLock(sb);
-+
-+ sbinfo = au_sbi(sb);
-+ fhsm = &sbinfo->si_fhsm;
-+ AuDebugOn(!fhsm);
-+ fhsm->fhsm_bottom = bindex;
-+}
-+
-+/* ---------------------------------------------------------------------- */
-+
-+static int au_fhsm_test_jiffy(struct au_sbinfo *sbinfo, struct au_branch *br)
-+{
-+ struct au_br_fhsm *bf;
-+
-+ bf = br->br_fhsm;
-+ MtxMustLock(&bf->bf_lock);
-+
-+ return !bf->bf_readable
-+ || time_after(jiffies,
-+ bf->bf_jiffy + sbinfo->si_fhsm.fhsm_expire);
-+}
-+
-+/* ---------------------------------------------------------------------- */
-+
-+static void au_fhsm_notify(struct super_block *sb, int val)
-+{
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
-+
-+ SiMustAnyLock(sb);
-+
-+ sbinfo = au_sbi(sb);
-+ fhsm = &sbinfo->si_fhsm;
-+ if (au_fhsm_pid(fhsm)
-+ && atomic_read(&fhsm->fhsm_readable) != -1) {
-+ atomic_set(&fhsm->fhsm_readable, val);
-+ if (val)
-+ wake_up(&fhsm->fhsm_wqh);
-+ }
-+}
-+
-+static int au_fhsm_stfs(struct super_block *sb, aufs_bindex_t bindex,
-+ struct aufs_stfs *rstfs, int do_lock, int do_notify)
-+{
-+ int err;
-+ struct au_branch *br;
-+ struct au_br_fhsm *bf;
-+
-+ br = au_sbr(sb, bindex);
-+ AuDebugOn(au_br_rdonly(br));
-+ bf = br->br_fhsm;
-+ AuDebugOn(!bf);
-+
-+ if (do_lock)
-+ mutex_lock(&bf->bf_lock);
-+ else
-+ MtxMustLock(&bf->bf_lock);
-+
-+ /* sb->s_root for NFS is unreliable */
-+ err = au_br_stfs(br, &bf->bf_stfs);
-+ if (unlikely(err)) {
-+ AuErr1("FHSM failed (%d), b%d, ignored.\n", bindex, err);
-+ goto out;
-+ }
-+
-+ bf->bf_jiffy = jiffies;
-+ bf->bf_readable = 1;
-+ if (do_notify)
-+ au_fhsm_notify(sb, /*val*/1);
-+ if (rstfs)
-+ *rstfs = bf->bf_stfs;
-+
-+out:
-+ if (do_lock)
-+ mutex_unlock(&bf->bf_lock);
-+ au_fhsm_notify(sb, /*val*/1);
-+
-+ return err;
-+}
-+
-+void au_fhsm_wrote(struct super_block *sb, aufs_bindex_t bindex, int force)
-+{
-+ int err;
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
-+ struct au_branch *br;
-+ struct au_br_fhsm *bf;
-+
-+ AuDbg("b%d, force %d\n", bindex, force);
-+ SiMustAnyLock(sb);
-+
-+ sbinfo = au_sbi(sb);
-+ fhsm = &sbinfo->si_fhsm;
-+ if (!au_ftest_si(sbinfo, FHSM)
-+ || fhsm->fhsm_bottom == bindex)
-+ return;
-+
-+ br = au_sbr(sb, bindex);
-+ bf = br->br_fhsm;
-+ AuDebugOn(!bf);
-+ mutex_lock(&bf->bf_lock);
-+ if (force
-+ || au_fhsm_pid(fhsm)
-+ || au_fhsm_test_jiffy(sbinfo, br))
-+ err = au_fhsm_stfs(sb, bindex, /*rstfs*/NULL, /*do_lock*/0,
-+ /*do_notify*/1);
-+ mutex_unlock(&bf->bf_lock);
-+}
-+
-+void au_fhsm_wrote_all(struct super_block *sb, int force)
-+{
-+ aufs_bindex_t bindex, bbot;
-+ struct au_branch *br;
-+
-+ /* exclude the bottom */
-+ bbot = au_fhsm_bottom(sb);
-+ for (bindex = 0; bindex < bbot; bindex++) {
-+ br = au_sbr(sb, bindex);
-+ if (au_br_fhsm(br->br_perm))
-+ au_fhsm_wrote(sb, bindex, force);
-+ }
-+}
-+
-+/* ---------------------------------------------------------------------- */
-+
-+static unsigned int au_fhsm_poll(struct file *file,
-+ struct poll_table_struct *wait)
-+{
-+ unsigned int mask;
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
-+
-+ mask = 0;
-+ sbinfo = file->private_data;
-+ fhsm = &sbinfo->si_fhsm;
-+ poll_wait(file, &fhsm->fhsm_wqh, wait);
-+ if (atomic_read(&fhsm->fhsm_readable))
-+ mask = POLLIN /* | POLLRDNORM */;
-+
-+ AuTraceErr((int)mask);
-+ return mask;
-+}
-+
-+static int au_fhsm_do_read_one(struct aufs_stbr __user *stbr,
-+ struct aufs_stfs *stfs, __s16 brid)
-+{
-+ int err;
-+
-+ err = copy_to_user(&stbr->stfs, stfs, sizeof(*stfs));
-+ if (!err)
-+ err = __put_user(brid, &stbr->brid);
-+ if (unlikely(err))
-+ err = -EFAULT;
-+
-+ return err;
-+}
-+
-+static ssize_t au_fhsm_do_read(struct super_block *sb,
-+ struct aufs_stbr __user *stbr, size_t count)
-+{
-+ ssize_t err;
-+ int nstbr;
-+ aufs_bindex_t bindex, bbot;
-+ struct au_branch *br;
-+ struct au_br_fhsm *bf;
-+
-+ /* except the bottom branch */
-+ err = 0;
-+ nstbr = 0;
-+ bbot = au_fhsm_bottom(sb);
-+ for (bindex = 0; !err && bindex < bbot; bindex++) {
-+ br = au_sbr(sb, bindex);
-+ if (!au_br_fhsm(br->br_perm))
-+ continue;
-+
-+ bf = br->br_fhsm;
-+ mutex_lock(&bf->bf_lock);
-+ if (bf->bf_readable) {
-+ err = -EFAULT;
-+ if (count >= sizeof(*stbr))
-+ err = au_fhsm_do_read_one(stbr++, &bf->bf_stfs,
-+ br->br_id);
-+ if (!err) {
-+ bf->bf_readable = 0;
-+ count -= sizeof(*stbr);
-+ nstbr++;
-+ }
-+ }
-+ mutex_unlock(&bf->bf_lock);
-+ }
-+ if (!err)
-+ err = sizeof(*stbr) * nstbr;
++ goto out;
++ nsi_lock.force_lock = 1;
+
-+ return err;
-+}
++ /* is this inode still cached? */
++ ino = decode_ino(fh + Fh_ino);
++ /* it should never happen */
++ if (unlikely(ino == AUFS_ROOT_INO))
++ goto out_unlock;
+
-+static ssize_t au_fhsm_read(struct file *file, char __user *buf, size_t count,
-+ loff_t *pos)
-+{
-+ ssize_t err;
-+ int readable;
-+ aufs_bindex_t nfhsm, bindex, bbot;
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
-+ struct au_branch *br;
-+ struct super_block *sb;
++ dir_ino = decode_ino(fh + Fh_dir_ino);
++ dentry = decode_by_ino(sb, ino, dir_ino);
++ if (IS_ERR(dentry))
++ goto out_unlock;
++ if (dentry)
++ goto accept;
+
-+ err = 0;
-+ sbinfo = file->private_data;
-+ fhsm = &sbinfo->si_fhsm;
-+need_data:
-+ spin_lock_irq(&fhsm->fhsm_wqh.lock);
-+ if (!atomic_read(&fhsm->fhsm_readable)) {
-+ if (vfsub_file_flags(file) & O_NONBLOCK)
-+ err = -EAGAIN;
-+ else
-+ err = wait_event_interruptible_locked_irq
-+ (fhsm->fhsm_wqh,
-+ atomic_read(&fhsm->fhsm_readable));
-+ }
-+ spin_unlock_irq(&fhsm->fhsm_wqh.lock);
-+ if (unlikely(err))
-+ goto out;
++ /* is the parent dir cached? */
++ br = au_sbr(sb, nsi_lock.bindex);
++ au_br_get(br);
++ dentry = decode_by_dir_ino(sb, ino, dir_ino, &nsi_lock);
++ if (IS_ERR(dentry))
++ goto out_unlock;
++ if (dentry)
++ goto accept;
+
-+ /* sb may already be dead */
-+ au_rw_read_lock(&sbinfo->si_rwsem);
-+ readable = atomic_read(&fhsm->fhsm_readable);
-+ if (readable > 0) {
-+ sb = sbinfo->si_sb;
-+ AuDebugOn(!sb);
-+ /* exclude the bottom branch */
-+ nfhsm = 0;
-+ bbot = au_fhsm_bottom(sb);
-+ for (bindex = 0; bindex < bbot; bindex++) {
-+ br = au_sbr(sb, bindex);
-+ if (au_br_fhsm(br->br_perm))
-+ nfhsm++;
-+ }
-+ err = -EMSGSIZE;
-+ if (nfhsm * sizeof(struct aufs_stbr) <= count) {
-+ atomic_set(&fhsm->fhsm_readable, 0);
-+ err = au_fhsm_do_read(sbinfo->si_sb, (void __user *)buf,
-+ count);
-+ }
-+ }
-+ au_rw_read_unlock(&sbinfo->si_rwsem);
-+ if (!readable)
-+ goto need_data;
++ /* lookup path */
++ dentry = decode_by_path(sb, ino, fh, fh_len, &nsi_lock);
++ if (IS_ERR(dentry))
++ goto out_unlock;
++ if (unlikely(!dentry))
++ /* todo?: make it ESTALE */
++ goto out_unlock;
+
++accept:
++ if (!au_digen_test(dentry, au_sigen(sb))
++ && d_inode(dentry)->i_generation == fh[Fh_igen])
++ goto out_unlock; /* success */
++
++ dput(dentry);
++ dentry = ERR_PTR(-ESTALE);
++out_unlock:
++ if (br)
++ au_br_put(br);
++ si_read_unlock(sb);
+out:
-+ return err;
++ AuTraceErrPtr(dentry);
++ return dentry;
+}
+
-+static int au_fhsm_release(struct inode *inode, struct file *file)
++#if 0 /* reserved for future use */
++/* support subtreecheck option */
++static struct dentry *aufs_fh_to_parent(struct super_block *sb, struct fid *fid,
++ int fh_len, int fh_type)
+{
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
++ struct dentry *parent;
++ __u32 *fh = fid->raw;
++ ino_t dir_ino;
+
-+ /* sb may already be dead */
-+ sbinfo = file->private_data;
-+ fhsm = &sbinfo->si_fhsm;
-+ spin_lock(&fhsm->fhsm_spin);
-+ fhsm->fhsm_pid = 0;
-+ spin_unlock(&fhsm->fhsm_spin);
-+ kobject_put(&sbinfo->si_kobj);
++ dir_ino = decode_ino(fh + Fh_dir_ino);
++ parent = decode_by_ino(sb, dir_ino, 0);
++ if (IS_ERR(parent))
++ goto out;
++ if (!parent)
++ parent = decode_by_path(sb, au_br_index(sb, fh[Fh_br_id]),
++ dir_ino, fh, fh_len);
+
-+ return 0;
++out:
++ AuTraceErrPtr(parent);
++ return parent;
+}
++#endif
+
-+static const struct file_operations au_fhsm_fops = {
-+ .owner = THIS_MODULE,
-+ .llseek = noop_llseek,
-+ .read = au_fhsm_read,
-+ .poll = au_fhsm_poll,
-+ .release = au_fhsm_release
-+};
++/* ---------------------------------------------------------------------- */
+
-+int au_fhsm_fd(struct super_block *sb, int oflags)
++static int aufs_encode_fh(struct inode *inode, __u32 *fh, int *max_len,
++ struct inode *dir)
+{
-+ int err, fd;
-+ struct au_sbinfo *sbinfo;
-+ struct au_fhsm *fhsm;
++ int err;
++ aufs_bindex_t bindex;
++ struct super_block *sb, *h_sb;
++ struct dentry *dentry, *parent, *h_parent;
++ struct inode *h_dir;
++ struct au_branch *br;
+
-+ err = -EPERM;
-+ if (unlikely(!capable(CAP_SYS_ADMIN)))
++ err = -ENOSPC;
++ if (unlikely(*max_len <= Fh_tail)) {
++ AuWarn1("NFSv2 client (max_len %d)?\n", *max_len);
+ goto out;
++ }
+
-+ err = -EINVAL;
-+ if (unlikely(oflags & ~(O_CLOEXEC | O_NONBLOCK)))
++ err = FILEID_ROOT;
++ if (inode->i_ino == AUFS_ROOT_INO) {
++ AuDebugOn(inode->i_ino != AUFS_ROOT_INO);
+ goto out;
++ }
+
-+ err = 0;
-+ sbinfo = au_sbi(sb);
-+ fhsm = &sbinfo->si_fhsm;
-+ spin_lock(&fhsm->fhsm_spin);
-+ if (!fhsm->fhsm_pid)
-+ fhsm->fhsm_pid = current->pid;
-+ else
-+ err = -EBUSY;
-+ spin_unlock(&fhsm->fhsm_spin);
++ h_parent = NULL;
++ sb = inode->i_sb;
++ err = si_read_lock(sb, AuLock_FLUSH);
+ if (unlikely(err))
+ goto out;
+
-+ oflags |= O_RDONLY;
-+ /* oflags |= FMODE_NONOTIFY; */
-+ fd = anon_inode_getfd("[aufs_fhsm]", &au_fhsm_fops, sbinfo, oflags);
-+ err = fd;
-+ if (unlikely(fd < 0))
-+ goto out_pid;
++#ifdef CONFIG_AUFS_DEBUG
++ if (unlikely(!au_opt_test(au_mntflags(sb), XINO)))
++ AuWarn1("NFS-exporting requires xino\n");
++#endif
++ err = -EIO;
++ parent = NULL;
++ ii_read_lock_child(inode);
++ bindex = au_ibtop(inode);
++ if (!dir) {
++ dentry = d_find_any_alias(inode);
++ if (unlikely(!dentry))
++ goto out_unlock;
++ AuDebugOn(au_test_anon(dentry));
++ parent = dget_parent(dentry);
++ dput(dentry);
++ if (unlikely(!parent))
++ goto out_unlock;
++ if (d_really_is_positive(parent))
++ dir = d_inode(parent);
++ }
+
-+ /* succeed reglardless 'fhsm' status */
-+ kobject_get(&sbinfo->si_kobj);
-+ si_noflush_read_lock(sb);
-+ if (au_ftest_si(sbinfo, FHSM))
-+ au_fhsm_wrote_all(sb, /*force*/0);
-+ si_read_unlock(sb);
-+ goto out; /* success */
++ ii_read_lock_parent(dir);
++ h_dir = au_h_iptr(dir, bindex);
++ ii_read_unlock(dir);
++ if (unlikely(!h_dir))
++ goto out_parent;
++ h_parent = d_find_any_alias(h_dir);
++ if (unlikely(!h_parent))
++ goto out_hparent;
+
-+out_pid:
-+ spin_lock(&fhsm->fhsm_spin);
-+ fhsm->fhsm_pid = 0;
-+ spin_unlock(&fhsm->fhsm_spin);
++ err = -EPERM;
++ br = au_sbr(sb, bindex);
++ h_sb = au_br_sb(br);
++ if (unlikely(!h_sb->s_export_op)) {
++ AuErr1("%s branch is not exportable\n", au_sbtype(h_sb));
++ goto out_hparent;
++ }
++
++ fh[Fh_br_id] = br->br_id;
++ fh[Fh_sigen] = au_sigen(sb);
++ encode_ino(fh + Fh_ino, inode->i_ino);
++ encode_ino(fh + Fh_dir_ino, dir->i_ino);
++ fh[Fh_igen] = inode->i_generation;
++
++ *max_len -= Fh_tail;
++ fh[Fh_h_type] = exportfs_encode_fh(h_parent, (void *)(fh + Fh_tail),
++ max_len,
++ /*connectable or subtreecheck*/0);
++ err = fh[Fh_h_type];
++ *max_len += Fh_tail;
++ /* todo: macros? */
++ if (err != FILEID_INVALID)
++ err = 99;
++ else
++ AuWarn1("%s encode_fh failed\n", au_sbtype(h_sb));
++
++out_hparent:
++ dput(h_parent);
++out_parent:
++ dput(parent);
++out_unlock:
++ ii_read_unlock(inode);
++ si_read_unlock(sb);
+out:
-+ AuTraceErr(err);
++ if (unlikely(err < 0))
++ err = FILEID_INVALID;
+ return err;
+}
+
+/* ---------------------------------------------------------------------- */
+
-+int au_fhsm_br_alloc(struct au_branch *br)
++static int aufs_commit_metadata(struct inode *inode)
+{
+ int err;
++ aufs_bindex_t bindex;
++ struct super_block *sb;
++ struct inode *h_inode;
++ int (*f)(struct inode *inode);
+
-+ err = 0;
-+ br->br_fhsm = kmalloc(sizeof(*br->br_fhsm), GFP_NOFS);
-+ if (br->br_fhsm)
-+ au_br_fhsm_init(br->br_fhsm);
-+ else
-+ err = -ENOMEM;
++ sb = inode->i_sb;
++ si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
++ ii_write_lock_child(inode);
++ bindex = au_ibtop(inode);
++ AuDebugOn(bindex < 0);
++ h_inode = au_h_iptr(inode, bindex);
+
-+ return err;
-+}
++ f = h_inode->i_sb->s_export_op->commit_metadata;
++ if (f)
++ err = f(h_inode);
++ else {
++ struct writeback_control wbc = {
++ .sync_mode = WB_SYNC_ALL,
++ .nr_to_write = 0 /* metadata only */
++ };
+
-+/* ---------------------------------------------------------------------- */
++ err = sync_inode(h_inode, &wbc);
++ }
+
-+void au_fhsm_fin(struct super_block *sb)
-+{
-+ au_fhsm_notify(sb, /*val*/-1);
++ au_cpup_attr_timesizes(inode);
++ ii_write_unlock(inode);
++ si_read_unlock(sb);
++ return err;
+}
+
-+void au_fhsm_init(struct au_sbinfo *sbinfo)
-+{
-+ struct au_fhsm *fhsm;
-+
-+ fhsm = &sbinfo->si_fhsm;
-+ spin_lock_init(&fhsm->fhsm_spin);
-+ init_waitqueue_head(&fhsm->fhsm_wqh);
-+ atomic_set(&fhsm->fhsm_readable, 0);
-+ fhsm->fhsm_expire
-+ = msecs_to_jiffies(AUFS_FHSM_CACHE_DEF_SEC * MSEC_PER_SEC);
-+ fhsm->fhsm_bottom = -1;
-+}
++/* ---------------------------------------------------------------------- */
+
-+void au_fhsm_set(struct au_sbinfo *sbinfo, unsigned int sec)
-+{
-+ sbinfo->si_fhsm.fhsm_expire
-+ = msecs_to_jiffies(sec * MSEC_PER_SEC);
-+}
++static struct export_operations aufs_export_op = {
++ .fh_to_dentry = aufs_fh_to_dentry,
++ /* .fh_to_parent = aufs_fh_to_parent, */
++ .encode_fh = aufs_encode_fh,
++ .commit_metadata = aufs_commit_metadata
++};
+
-+void au_fhsm_show(struct seq_file *seq, struct au_sbinfo *sbinfo)
++void au_export_init(struct super_block *sb)
+{
-+ unsigned int u;
++ struct au_sbinfo *sbinfo;
++ __u32 u;
+
-+ if (!au_ftest_si(sbinfo, FHSM))
-+ return;
++ BUILD_BUG_ON_MSG(IS_BUILTIN(CONFIG_AUFS_FS)
++ && IS_MODULE(CONFIG_EXPORTFS),
++ AUFS_NAME ": unsupported configuration "
++ "CONFIG_EXPORTFS=m and CONFIG_AUFS_FS=y");
+
-+ u = jiffies_to_msecs(sbinfo->si_fhsm.fhsm_expire) / MSEC_PER_SEC;
-+ if (u != AUFS_FHSM_CACHE_DEF_SEC)
-+ seq_printf(seq, ",fhsm_sec=%u", u);
++ sb->s_export_op = &aufs_export_op;
++ sbinfo = au_sbi(sb);
++ sbinfo->si_xigen = NULL;
++ get_random_bytes(&u, sizeof(u));
++ BUILD_BUG_ON(sizeof(u) != sizeof(int));
++ atomic_set(&sbinfo->si_xigen_next, u);
+}
-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 2017-11-12 22:24:44.704244405 +0100
-@@ -0,0 +1,856 @@
+diff -urNp -x '*.orig' linux-4.14/fs/aufs/f_op.c linux-4.14/fs/aufs/f_op.c
+--- linux-4.14/fs/aufs/f_op.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.14/fs/aufs/f_op.c 2021-02-24 21:42:43.447781402 +0100
+@@ -0,0 +1,817 @@
+/*
+ * Copyright (C) 2005-2017 Junjiro R. Okajima
+ *
@@ -14122,850 +12968,811 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
+ */
+
+/*
-+ * handling file/dir, and address_space operation
++ * file and vm operations
+ */
+
-+#ifdef CONFIG_AUFS_DEBUG
-+#include <linux/migrate.h>
-+#endif
-+#include <linux/pagemap.h>
++#include <linux/aio.h>
++#include <linux/fs_stack.h>
++#include <linux/mman.h>
++#include <linux/security.h>
+#include "aufs.h"
+
-+/* drop flags for writing */
-+unsigned int au_file_roflags(unsigned int flags)
++int au_do_open_nondir(struct file *file, int flags, struct file *h_file)
+{
-+ flags &= ~(O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC);
-+ flags |= O_RDONLY | O_NOATIME;
-+ return flags;
++ int err;
++ aufs_bindex_t bindex;
++ struct dentry *dentry, *h_dentry;
++ struct au_finfo *finfo;
++ struct inode *h_inode;
++
<Skipped 19738 lines>
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/0b1ff5c39eea82ab2fe9536956ae20c2bd9776cc
More information about the pld-cvs-commit
mailing list