aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2021-10-03 22:42:24 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2021-10-18 22:59:50 +0200
commit57840b529575bd643d33c77b4d3767f13625a4bc (patch)
tree439e38a6279e1e185ba2d3e87cfeaf2f7e86c48c
parent675191322abda45b024535eb8834e7bc7a13f87c (diff)
downloadbackports-57840b529575bd643d33c77b4d3767f13625a4bc.tar.gz
backports: Remove coredump subsystem backport
This is not needed on kernel 4.0 and later. These kernel versions already ship a compatible coredump system. Keep the BPAUTO_WANT_DEV_COREDUMP. Drivers can use WANT_DEV_COREDUMP if they want to make it possible to select DEV_COREDUMP, but this is not working with backports. This leaves the dummy option. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/devcoredump.h (renamed from backport/backport-include/linux/bp-devcoredump.h)6
-rw-r--r--backport/compat/Kconfig8
-rw-r--r--backport/compat/backport-4.7.c11
-rw-r--r--backport/compat/backports.h16
-rw-r--r--backport/compat/main.c11
-rw-r--r--patches/devcoredump.patch67
6 files changed, 5 insertions, 114 deletions
diff --git a/backport/backport-include/linux/bp-devcoredump.h b/backport/backport-include/linux/devcoredump.h
index 4a8c228b..49b7c30d 100644
--- a/backport/backport-include/linux/bp-devcoredump.h
+++ b/backport/backport-include/linux/devcoredump.h
@@ -1,5 +1,6 @@
#ifndef __BACKPORT_LINUX_DEVCOREDUMP_H
#define __BACKPORT_LINUX_DEVCOREDUMP_H
+#include_next <linux/devcoredump.h>
#include <linux/version.h>
#include <linux/scatterlist.h>
@@ -15,10 +16,9 @@ void backport_dev_coredumpm(struct device *dev, struct module *owner,
size_t datalen),
void (*free_fn)(void *data))
{
- return dev_coredumpm(dev, owner, (const void *)data, datalen, gfp,
- (void *)read_fn, (void *)free_fn);
+ dev_coredumpm(dev, owner, (const void *)data, datalen, gfp,
+ (void *)read_fn, (void *)free_fn);
}
-
#define dev_coredumpm LINUX_BACKPORT(dev_coredumpm)
#define dev_coredumpsg LINUX_BACKPORT(dev_coredumpsg)
diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index 625b605e..174322d8 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -79,14 +79,6 @@ config BPAUTO_USERSEL_BUILD_ALL
config BPAUTO_WANT_DEV_COREDUMP
bool
-config BPAUTO_BUILD_WANT_DEV_COREDUMP
- bool
- default n if DEV_COREDUMP
- default n if DISABLE_DEV_COREDUMP
- default y if BPAUTO_WANT_DEV_COREDUMP
- #h-file linux/devcoredump.h
- #c-file drivers/base/devcoredump.c
-
config BPAUTO_RHASHTABLE
bool
# current API of rhashtable was introduced in version 4.9
diff --git a/backport/compat/backport-4.7.c b/backport/compat/backport-4.7.c
index b47764e6..d261abe6 100644
--- a/backport/compat/backport-4.7.c
+++ b/backport/compat/backport-4.7.c
@@ -8,9 +8,11 @@
* published by the Free Software Foundation.
*/
+#include <linux/devcoredump.h>
#include <linux/export.h>
#include <linux/list.h>
#include <linux/rcupdate.h>
+#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
@@ -116,14 +118,6 @@ int nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen,
}
EXPORT_SYMBOL_GPL(nla_put_64bit);
-/*
- * Below 3.18 or if the kernel has devcoredump disabled, we copied the
- * entire devcoredump, so no need to define these functions.
- */
-#if !defined(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP)
-#include <linux/devcoredump.h>
-#include <linux/scatterlist.h>
-
static void devcd_free_sgtable(void *data)
{
struct scatterlist *table = data;
@@ -180,4 +174,3 @@ void dev_coredumpsg(struct device *dev, struct scatterlist *table,
(void *)devcd_free_sgtable);
}
EXPORT_SYMBOL_GPL(dev_coredumpsg);
-#endif /* !CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP */
diff --git a/backport/compat/backports.h b/backport/compat/backports.h
deleted file mode 100644
index 53848888..00000000
--- a/backport/compat/backports.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef LINUX_BACKPORTS_PRIVATE_H
-#define LINUX_BACKPORTS_PRIVATE_H
-
-#include <linux/version.h>
-
-#ifdef CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP
-int devcoredump_init(void);
-void devcoredump_exit(void);
-#else
-static inline int devcoredump_init(void)
-{ return 0; }
-static inline void devcoredump_exit(void)
-{}
-#endif
-
-#endif /* LINUX_BACKPORTS_PRIVATE_H */
diff --git a/backport/compat/main.c b/backport/compat/main.c
index 0bf04201..2540e757 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -2,7 +2,6 @@
#include <linux/init.h>
#include <linux/pm_qos.h>
#include <linux/workqueue.h>
-#include "backports.h"
MODULE_AUTHOR("Luis R. Rodriguez");
MODULE_DESCRIPTION("Kernel backport module");
@@ -53,10 +52,6 @@ EXPORT_SYMBOL_GPL(backport_dependency_symbol);
static int __init backport_init(void)
{
- int ret = devcoredump_init();
- if (ret)
- return ret;
-
printk(KERN_INFO "Loading modules backported from " CPTCFG_KERNEL_NAME
#ifndef BACKPORTS_GIT_TRACKED
" version " CPTCFG_KERNEL_VERSION
@@ -77,9 +72,3 @@ static int __init backport_init(void)
return 0;
}
subsys_initcall(backport_init);
-
-static void __exit backport_exit(void)
-{
- devcoredump_exit();
-}
-module_exit(backport_exit);
diff --git a/patches/devcoredump.patch b/patches/devcoredump.patch
deleted file mode 100644
index e56d52c8..00000000
--- a/patches/devcoredump.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- a/compat/drivers-base-devcoredump.c
-+++ b/compat/drivers-base-devcoredump.c
-@@ -16,6 +16,7 @@
- #include <linux/slab.h>
- #include <linux/fs.h>
- #include <linux/workqueue.h>
-+#include "backports.h"
-
- static struct class devcd_class;
-
-@@ -54,8 +55,7 @@ static void devcd_dev_release(struct dev
- * a struct device to know when it goes away?
- */
- if (devcd->failing_dev->kobj.sd)
-- sysfs_delete_link(&devcd->failing_dev->kobj, &dev->kobj,
-- "devcoredump");
-+ sysfs_remove_link(&devcd->failing_dev->kobj, "devcoredump");
-
- put_device(devcd->failing_dev);
- kfree(devcd);
-@@ -334,15 +334,13 @@ void dev_coredumpsg(struct device *dev,
- }
- EXPORT_SYMBOL_GPL(dev_coredumpsg);
-
--static int __init devcoredump_init(void)
-+int __init devcoredump_init(void)
- {
- return class_register(&devcd_class);
- }
--__initcall(devcoredump_init);
-
--static void __exit devcoredump_exit(void)
-+void __exit devcoredump_exit(void)
- {
- class_for_each_device(&devcd_class, NULL, NULL, devcd_free);
- class_unregister(&devcd_class);
- }
--__exitcall(devcoredump_exit);
---- a/include/linux/backport-devcoredump.h
-+++ b/include/linux/backport-devcoredump.h
-@@ -51,7 +51,7 @@ static inline void _devcd_free_sgtable(s
- }
-
-
--#ifdef CONFIG_DEV_COREDUMP
-+#ifdef CPTCFG_BPAUTO_WANT_DEV_COREDUMP
- void dev_coredumpv(struct device *dev, void *data, size_t datalen,
- gfp_t gfp);
-
-@@ -85,6 +85,6 @@ static inline void dev_coredumpsg(struct
- {
- _devcd_free_sgtable(table);
- }
--#endif /* CONFIG_DEV_COREDUMP */
-+#endif /* CPTCFG_BPAUTO_WANT_DEV_COREDUMP */
-
- #endif /* __DEVCOREDUMP_H */
---- a/include/linux/devcoredump.h
-+++ b/include/linux/devcoredump.h
-@@ -1,6 +1,7 @@
- /* Automatically created during backport process */
- #ifndef CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP
- #include_next <linux/devcoredump.h>
-+#include <linux/bp-devcoredump.h>
- #else
- #undef dev_coredumpv
- #define dev_coredumpv LINUX_BACKPORT(dev_coredumpv)