From 1af5910dfd5263ebf5653c223f72f55d8aca17aa Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Mon, 16 Aug 2021 10:32:22 -0400
Subject: [PATCH] aufs: update kmalloc_index to v5.14+ restrictions

1/1 [
Author: Bruce Ashfield
Email: bruce.ashfield@gmail.com
Subject: aufs: update kmalloc_index to v5.14+ restrictions
Date: Mon, 16 Aug 2021 10:21:01 -0400

commit 588c7fa022d7b [mm, slub: change run-time assertion in
kmalloc_index() to compile-time], means that the non-constant
aufs kmalloc call, should go (temporarily) to the __kmalloc_index
directly, so the compile time BUG is not triggered.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
]
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 ...-kmalloc_index-to-v5.14-restrictions.patch | 31 +++++++++++++++++++
 features/aufs/aufs.scc                        |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 features/aufs/aufs-update-kmalloc_index-to-v5.14-restrictions.patch

diff --git a/features/aufs/aufs-update-kmalloc_index-to-v5.14-restrictions.patch b/features/aufs/aufs-update-kmalloc_index-to-v5.14-restrictions.patch
new file mode 100644
index 000000000..b89e4f78b
--- /dev/null
+++ b/features/aufs/aufs-update-kmalloc_index-to-v5.14-restrictions.patch
@@ -0,0 +1,31 @@
+From e34e151b59703392227edee6a91732d63a8ca552 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Mon, 16 Aug 2021 10:21:01 -0400
+Subject: [PATCH] aufs: update kmalloc_index to v5.14+ restrictions
+
+commit 588c7fa022d7b [mm, slub: change run-time assertion in
+kmalloc_index() to compile-time], means that the non-constant
+aufs kmalloc call, should go (temporarily) to the __kmalloc_index
+directly, so the compile time BUG is not triggered.
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ fs/aufs/module.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/aufs/module.h b/fs/aufs/module.h
+index d6a76788d2ff..6c18688d0e3f 100644
+--- a/fs/aufs/module.h
++++ b/fs/aufs/module.h
+@@ -97,7 +97,7 @@ static inline void au_kfree_small(const void *p)
+ static inline int au_kmidx_sub(size_t sz, size_t new_sz)
+ {
+ #ifndef CONFIG_SLOB
+-	return kmalloc_index(sz) - kmalloc_index(new_sz);
++	return __kmalloc_index(sz,false) - __kmalloc_index(new_sz,false);
+ #else
+ 	return -1; /* SLOB is untested */
+ #endif
+-- 
+2.19.1
+
diff --git a/features/aufs/aufs.scc b/features/aufs/aufs.scc
index 729882dfc..5351ebb47 100644
--- a/features/aufs/aufs.scc
+++ b/features/aufs/aufs.scc
@@ -5,3 +5,4 @@ patch aufs5-aufs-mmap.patch
 patch aufs5-aufs-standalone.patch
 patch aufs5-aufs-kbuild.patch
 patch aufs5-core.patch
+patch aufs-update-kmalloc_index-to-v5.14-restrictions.patch
-- 
GitLab