From f745b2de56095a48dd7622210f6e104dd170dfdf Mon Sep 17 00:00:00 2001 From: Fengqian Gao Date: Thu, 14 Nov 2019 06:28:01 -0500 Subject: [PATCH] Binderfs compiling bug fixing on kernel higher than 5.3.0 Currently used binderfs code are back-ported from kernel 4.21 sget_userns function is removed in kernel 5.3.0, which failed the compiling of binderfs. Binderfs source code will be updated in later patches. Tracked-On: OAM-88513 Signed-off-by: Hongcheng Xie Signed-off-by: Fengqian Gao --- binder/binderfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/binder/binderfs.c b/binder/binderfs.c index f54f842..5199a35 100644 --- a/binder/binderfs.c +++ b/binder/binderfs.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -477,6 +478,19 @@ static struct dentry *binderfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { + +/* + sget_userns function is removed in kernel version higher than 5.3 + This will fail the compiling of binderfs, since currently used binderfs is + backport from kernel 4.21 + In the latest binderfs code, these codes are changed too. + So, this is a hotfix which enabing CIC on kernel high than 5.3.0 + (TODO) Update binderfs code +*/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0) + return mount_nodev(fs_type, flags, data, binderfs_fill_super); + +#else struct super_block *sb; struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns; @@ -499,6 +513,8 @@ static struct dentry *binderfs_mount(struct file_system_type *fs_type, } return dget(sb->s_root); + +#endif } static void binderfs_kill_super(struct super_block *sb)