[packages/kernel] - builds without aufs

arekm arekm at pld-linux.org
Mon Jul 8 11:43:28 CEST 2019


commit 83b672a51e9edc3f3b318b89b3642bf3b966dcea
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Jul 8 11:43:05 2019 +0200

    - builds without aufs

 kernel-aufs4.patch | 145 ++++++++++++++++++++++-------------------------------
 kernel.spec        |   2 +-
 2 files changed, 60 insertions(+), 87 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index b8e3abf0..d5404faa 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -246,7 +246,7 @@ BuildRequires:	libstdc++-devel
 BuildRequires:	openssl-devel
 BuildRequires:	perl-base
 BuildRequires:	rpm-build >= 4.5-24
-BuildRequires:	rpmbuild(macros) >= 1.707
+BuildRequires:	rpmbuild(macros) >= 1.743
 %ifarch ppc
 BuildRequires:	uboot-mkimage
 %endif
diff --git a/kernel-aufs4.patch b/kernel-aufs4.patch
index 20e694b1..85ea3f4e 100644
--- a/kernel-aufs4.patch
+++ b/kernel-aufs4.patch
@@ -1,11 +1,10 @@
 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"
@@ -855,18 +854,10 @@ index 9b6a3d0f87a1..8c4d3d56f2df 100644
  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);
  }
@@ -874,7 +865,7 @@ index c03b83662876..817f22c6e191 100644
  
  /*
   * 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);
  }
@@ -882,7 +873,7 @@ index c03b83662876..817f22c6e191 100644
  
  /*
   * 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;
  }
@@ -1039,44 +1030,17 @@ index 0fef395662a6..83fb1ecfc33d 100644
  	}
  }
 +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)
@@ -1127,15 +1091,7 @@ index 55bc49027ba9..870eaa8ebedc 100644
  
  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);
  }
@@ -1143,7 +1099,7 @@ index 55bc49027ba9..870eaa8ebedc 100644
  
  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);
  }
@@ -1151,7 +1107,7 @@ index 55bc49027ba9..870eaa8ebedc 100644
  
  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);
  }
@@ -2654,8 +2610,8 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt lin
 +regular files only.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documentation/filesystems/aufs/README
 --- /usr/share/empty/Documentation/filesystems/aufs/README	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/README	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
@@ -2910,6 +2866,13 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documenta
 +  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
@@ -4546,8 +4509,8 @@ diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 +}
 diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 --- /usr/share/empty/fs/aufs/branch.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.h	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
@@ -4775,7 +4738,8 @@ diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 +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 {
@@ -12514,7 +12478,7 @@ diff -urN /usr/share/empty/fs/aufs/dirren.h linux/fs/aufs/dirren.h
 +#endif /* __AUFS_DIRREN_H__ */
 diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 --- /usr/share/empty/fs/aufs/dynop.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.c	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
 +/*
@@ -12558,8 +12522,8 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 +	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);
@@ -12613,8 +12577,8 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 +	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)
@@ -12632,7 +12596,7 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 +
 +	key = container_of(rcu, struct au_dykey, dk_rcu);
 +	DyPrSym(key);
-+	au_kfree_rcu(key);
++	kfree(key);
 +}
 +
 +static void dy_free(struct kref *kref)
@@ -17069,7 +17033,7 @@ diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 +static int au_hfsn_handle_event(struct fsnotify_group *group,
 +				struct inode *inode,
 +				u32 mask, const void *data, int data_type,
-+				const unsigned char *file_name, u32 cookie,
++				const struct qstr *file_name, u32 cookie,
 +				struct fsnotify_iter_info *iter_info)
 +{
 +	int err;
@@ -24501,7 +24465,7 @@ diff -urN /usr/share/empty/fs/aufs/loop.c linux/fs/aufs/loop.c
 +}
 diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
 --- /usr/share/empty/fs/aufs/loop.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.h	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 */
 +/*
@@ -24545,7 +24509,7 @@ diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
 +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)
@@ -25802,7 +25766,7 @@ diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 +}
 diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 --- /usr/share/empty/fs/aufs/opts.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.c	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
 +/*
@@ -26724,7 +26688,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +	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;
@@ -28594,7 +28558,7 @@ diff -urN /usr/share/empty/fs/aufs/posix_acl.c linux/fs/aufs/posix_acl.c
 +}
 diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
 --- /usr/share/empty/fs/aufs/procfs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/procfs.c	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
 +/*
@@ -28659,8 +28623,8 @@ diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
 +	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);
@@ -36946,8 +36910,8 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +}
 diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 --- /usr/share/empty/fs/aufs/xino.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xino.c	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
@@ -37110,22 +37074,28 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +/*
 + * 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;
@@ -37135,6 +37105,8 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +	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);
@@ -38617,11 +38589,12 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +		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;
@@ -38906,7 +38879,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +}
 diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/linux/aufs_type.h
 --- /usr/share/empty/include/uapi/linux/aufs_type.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/include/uapi/linux/aufs_type.h	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 */
 +/*
@@ -38950,7 +38923,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +
 +#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')
@@ -39548,7 +39521,7 @@ index f05887d612fd..6f0505723cb4 100644
 +	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);
@@ -39558,7 +39531,7 @@ index c42cbe71ed4b..255e2d3763e7 100644
 +
 +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)
  
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/83b672a51e9edc3f3b318b89b3642bf3b966dcea



More information about the pld-cvs-commit mailing list