SPDX-License-Identifier: GPL-2.0
aufs4.x-rcN kbuild patch
-diff --git a/fs/Kconfig b/fs/Kconfig
-index ac474a61be37..284cee954591 100644
---- a/fs/Kconfig
-+++ b/fs/Kconfig
-@@ -255,5 +255,6 @@ source "fs/pstore/Kconfig"
+--- linux-5.2/fs/Kconfig~ 2019-07-08 00:41:56.000000000 +0200
++++ linux-5.2/fs/Kconfig 2019-07-08 09:33:44.244881357 +0200
+@@ -261,6 +261,7 @@ source "fs/romfs/Kconfig"
+ source "fs/pstore/Kconfig"
source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
+source "fs/aufs/Kconfig"
static void cleanup_group_ids(struct mount *mnt, struct mount *end)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
-index c03b83662876..817f22c6e191 100644
+index c03b83662876..94d210ca384a 100644
--- a/fs/notify/group.c
+++ b/fs/notify/group.c
-@@ -23,6 +23,7 @@
- #include <linux/rculist.h>
- #include <linux/wait.h>
- #include <linux/memcontrol.h>
-+#include <linux/module.h>
-
- #include <linux/fsnotify_backend.h>
- #include "fsnotify.h"
-@@ -112,6 +113,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
+@@ -112,6 +112,7 @@ void fsnotify_get_group(struct fsnotify_group *group)
{
refcount_inc(&group->refcnt);
}
/*
* Drop a reference to a group. Free it if it's through.
-@@ -121,6 +123,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
+@@ -121,6 +122,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
if (refcount_dec_and_test(&group->refcnt))
fsnotify_final_destroy_group(group);
}
/*
* Create a new fsnotify_group and hold a reference for the group returned.
-@@ -150,6 +153,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
+@@ -150,6 +152,7 @@ struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops)
return group;
}
}
}
+EXPORT_SYMBOL_GPL(task_work_run);
-diff --git a/security/commoncap.c b/security/commoncap.c
-index 232db019f051..a402a5b72bf4 100644
---- a/security/commoncap.c
-+++ b/security/commoncap.c
-@@ -1332,12 +1332,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 cd97929fac66..424fd230866d 100644
+index cd97929fac66..20c59b2e3b26 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
-@@ -8,6 +8,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>
-@@ -824,3 +825,4 @@ int __devcgroup_check_permission(short type, u32 major, u32 minor,
+@@ -824,3 +824,4 @@ int __devcgroup_check_permission(short type, u32 major, u32 minor,
return 0;
}
+EXPORT_SYMBOL_GPL(__devcgroup_check_permission);
diff --git a/security/security.c b/security/security.c
-index 55bc49027ba9..870eaa8ebedc 100644
+index 55bc49027ba9..b46c4eef1960 100644
--- a/security/security.c
+++ b/security/security.c
@@ -566,6 +566,7 @@ int security_path_rmdir(const struct path *dir, struct dentry *dentry)
int security_path_chroot(const struct path *path)
{
-@@ -716,6 +722,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)
-@@ -731,6 +738,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -731,6 +737,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return call_int_hook(inode_permission, 0, inode, mask);
}
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
-@@ -902,6 +910,7 @@ int security_file_permission(struct file *file, int mask)
+@@ -902,6 +909,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
int security_file_alloc(struct file *file)
{
-@@ -961,6 +970,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
+@@ -961,6 +969,7 @@ int security_mmap_file(struct file *file, unsigned long prot,
return ret;
return ima_file_mmap(file, prot);
}
+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 2018-12-27 13:19:17.705082621 +0100
-@@ -0,0 +1,395 @@
++++ linux/Documentation/filesystems/aufs/README 2019-07-08 09:31:38.324384703 +0200
+@@ -0,0 +1,402 @@
+
+Aufs4 -- advanced multi layered unification filesystem version 4.x
+http://aufs.sf.net
+ 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".
++- proc_mounts.patch
++ When there are many mountpoints and many mount(2)/umount(2) are
++ running, then /proc/mounts may not show the all mountpoints. This
++ patch makes /proc/mounts always show the full mountpoints list.
++ If you don't want to apply this patch and meet such problem, then you
++ need to increase the value of 'ProcMounts_Times' make-variable in
++ aufs-util.git as a second best solution.
+- 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
+}
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 2019-03-05 12:13:00.135890907 +0100
-@@ -0,0 +1,365 @@
++++ linux/fs/aufs/branch.h 2019-07-08 09:31:38.324384703 +0200
+@@ -0,0 +1,366 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2005-2019 Junjiro R. Okajima
+static const loff_t au_loff_max = LLONG_MAX;
+
+aufs_bindex_t au_xi_root(struct super_block *sb, struct dentry *dentry);
-+struct file *au_xino_create(struct super_block *sb, char *fpath, int silent);
++struct file *au_xino_create(struct super_block *sb, char *fpath, int silent,
++ int wbrtop);
+struct file *au_xino_create2(struct super_block *sb, struct path *base,
+ struct file *copy_src);
+struct au_xi_new {
+#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 2019-03-05 12:13:00.139224339 +0100
++++ linux/fs/aufs/dynop.c 2019-07-08 09:31:38.324384703 +0200
@@ -0,0 +1,370 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ hlist_bl_lock(hbl);
+ hlist_bl_for_each_entry(tmp, pos, hbl, dk_hnode)
+ if (tmp->dk_op.dy_hop == h_op) {
-+ key = tmp;
-+ kref_get(&key->dk_kref);
++ if (kref_get_unless_zero(&tmp->dk_kref))
++ key = tmp;
+ break;
+ }
+ hlist_bl_unlock(hbl);
+ hlist_bl_lock(hbl);
+ hlist_bl_for_each_entry(tmp, pos, hbl, dk_hnode)
+ if (tmp->dk_op.dy_hop == h_op) {
-+ kref_get(&tmp->dk_kref);
-+ found = tmp;
++ if (kref_get_unless_zero(&tmp->dk_kref))
++ found = tmp;
+ break;
+ }
+ if (!found)
+
+ key = container_of(rcu, struct au_dykey, dk_rcu);
+ DyPrSym(key);
-+ au_kfree_rcu(key);
++ kfree(key);
+}
+
+static void dy_free(struct kref *kref)
+static int au_hfsn_handle_event(struct fsnotify_group *group,
+ struct inode *inode,
+ u32 mask, const void *data, int data_type,
-+ const unsigned char *file_name, u32 cookie,
++ const struct qstr *file_name, u32 cookie,
+ struct fsnotify_iter_info *iter_info)
+{
+ int err;
+}
diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
--- /usr/share/empty/fs/aufs/loop.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.h 2019-05-06 09:03:04.820143837 +0200
++++ linux/fs/aufs/loop.h 2019-07-08 09:31:38.324384703 +0200
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+int au_loopback_init(void);
+void au_loopback_fin(void);
+#else
-+AuStub(struct file *, loop_backing_file, return NULL)
++AuStub(struct file *, loop_backing_file, return NULL, struct super_block *sb)
+
+AuStubInt0(au_test_loopback_overlap, struct super_block *sb,
+ struct dentry *h_adding)
+}
diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
--- /usr/share/empty/fs/aufs/opts.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.c 2019-03-05 12:13:00.142557771 +0100
++++ linux/fs/aufs/opts.c 2019-07-08 09:31:38.324384703 +0200
@@ -0,0 +1,1877 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ int err;
+ struct file *file;
+
-+ file = au_xino_create(sb, args[0].from, /*silent*/0);
++ file = au_xino_create(sb, args[0].from, /*silent*/0, /*wbrtop*/0);
+ err = PTR_ERR(file);
+ if (IS_ERR(file))
+ goto out;
+}
diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
--- /usr/share/empty/fs/aufs/procfs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/procfs.c 2019-03-05 12:13:00.142557771 +0100
++++ linux/fs/aufs/procfs.c 2019-07-08 09:31:38.324384703 +0200
@@ -0,0 +1,171 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ hlist_bl_lock(&au_sbilist);
+ hlist_bl_for_each_entry(sbinfo, pos, &au_sbilist, si_list)
+ if (id == sysaufs_si_id(sbinfo)) {
-+ kobject_get(&sbinfo->si_kobj);
-+ sb = sbinfo->si_sb;
++ if (kobject_get_unless_zero(&sbinfo->si_kobj))
++ sb = sbinfo->si_sb;
+ break;
+ }
+ hlist_bl_unlock(&au_sbilist);
+}
diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
--- /usr/share/empty/fs/aufs/xino.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xino.c 2019-03-05 12:13:00.145891204 +0100
-@@ -0,0 +1,1956 @@
++++ linux/fs/aufs/xino.c 2019-07-08 09:31:38.327718137 +0200
+@@ -0,0 +1,1965 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2005-2019 Junjiro R. Okajima
+/*
+ * create and set a new xino file
+ */
-+struct file *au_xino_create(struct super_block *sb, char *fpath, int silent)
++struct file *au_xino_create(struct super_block *sb, char *fpath, int silent,
++ int wbrtop)
+{
+ struct file *file;
+ struct dentry *h_parent, *d;
+ struct inode *h_dir, *inode;
+ int err;
++ static DEFINE_MUTEX(mtx);
+
+ /*
+ * at mount-time, and the xino file is the default path,
+ * hnotify is disabled so we have no notify events to ignore.
+ * when a user specified the xino, we cannot get au_hdir to be ignored.
+ */
++ if (!wbrtop)
++ mutex_lock(&mtx);
+ file = vfsub_filp_open(fpath, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE
+ /* | __FMODE_NONOTIFY */,
+ 0666);
+ if (IS_ERR(file)) {
++ if (!wbrtop)
++ mutex_unlock(&mtx);
+ if (!silent)
+ pr_err("open %s(%ld)\n", fpath, PTR_ERR(file));
+ return file;
+ err = 0;
+ d = file->f_path.dentry;
+ h_parent = au_dget_parent_lock(d, AuLsc_I_PARENT);
++ if (!wbrtop)
++ mutex_unlock(&mtx);
+ /* mnt_want_write() is unnecessary here */
+ h_dir = d_inode(h_parent);
+ inode = file_inode(file);
+ if (!IS_ERR(p)) {
+ strcat(p, "/" AUFS_XINO_FNAME);
+ AuDbg("%s\n", p);
-+ file = au_xino_create(sb, p, /*silent*/0);
++ file = au_xino_create(sb, p, /*silent*/0, /*wbrtop*/1);
+ }
+ free_page((unsigned long)page);
+ } else {
-+ file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0);
++ file = au_xino_create(sb, AUFS_XINO_DEFPATH, /*silent*/0,
++ /*wbrtop*/0);
+ if (IS_ERR(file))
+ goto out;
+ h_sb = file->f_path.dentry->d_sb;
+}
diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/linux/aufs_type.h
--- /usr/share/empty/include/uapi/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/include/uapi/linux/aufs_type.h 2019-05-06 09:03:04.820143837 +0200
++++ linux/include/uapi/linux/aufs_type.h 2019-07-08 09:31:38.327718137 +0200
@@ -0,0 +1,448 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+
+#include <linux/limits.h>
+
-+#define AUFS_VERSION "4.x-rcN-20190311"
++#define AUFS_VERSION "4.x-rcN-20190610"
+
+/* todo? move this to linux-2.6.19/include/magic.h */
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
+ return f;
+}
diff --git a/fs/aufs/loop.h b/fs/aufs/loop.h
-index c42cbe71ed4b..255e2d3763e7 100644
+index f31e40aff267..e13fb1a0717a 100644
--- a/fs/aufs/loop.h
+++ b/fs/aufs/loop.h
@@ -26,6 +26,8 @@ void au_warn_loopback(struct super_block *h_sb);
+
+struct file *aufs_real_loop(struct file *file);
#else
- AuStub(struct file *, loop_backing_file, return NULL)
+ AuStub(struct file *, loop_backing_file, return NULL, struct super_block *sb)
@@ -36,6 +38,8 @@ AuStubVoid(au_warn_loopback, struct super_block *h_sb)