hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in kernfs_* struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) kernfs_syscall_ops 40 3 64 kernfs_root 216 5 256 kernfs_ops 96 4 128 kernfs_open_node 72 3 96
Signed-off-by: Long Li leo.lilong@huawei.com --- fs/kernfs/file.c | 4 ++++ fs/kernfs/kernfs-internal.h | 6 ++++++ include/linux/kernfs.h | 10 ++++++++++ 3 files changed, 20 insertions(+)
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index 180906c36f51..1cbf9a44422e 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -25,6 +25,10 @@ struct kernfs_open_node { struct list_head files; /* goes through kernfs_open_file.list */ unsigned int nr_mmapped; unsigned int nr_to_release; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
/* diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h index a9b854cdfdb5..ade12719da29 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h @@ -49,6 +49,12 @@ struct kernfs_root { struct rw_semaphore kernfs_rwsem; struct rw_semaphore kernfs_iattr_rwsem; struct rw_semaphore kernfs_supers_rwsem; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) };
/* +1 to avoid triggering overflow warning when negating it */ diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 2a36f3218b51..bd3fbcb3c3f6 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -6,6 +6,7 @@ #ifndef __LINUX_KERNFS_H #define __LINUX_KERNFS_H
+#include <linux/kabi.h> #include <linux/err.h> #include <linux/list.h> #include <linux/mutex.h> @@ -242,6 +243,10 @@ struct kernfs_syscall_ops { const char *new_name); int (*show_path)(struct seq_file *sf, struct kernfs_node *kn, struct kernfs_root *root); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
struct kernfs_node *kernfs_root_to_node(struct kernfs_root *root); @@ -316,6 +321,11 @@ struct kernfs_ops { struct poll_table_struct *pt);
int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
/*