Skip to content

Commit eca3287

Browse files
backslashxxChristoph HellwigFede2782OnlyTomInSecond
authored andcommitted
Suggest non-gki kernel users to backport path_umount (#1464)
Most kernel builders have to touch their kernel source code anyway, why not also tell them to backport path_umount so even non-gki users can benefit from this? I know this might be a bit controversial as this will raise the barrier of entry, but the benefits are just so high. Idea was from OnlyTomInSecond on KernelSU group chat way back, and it has been on the discussions for some time references: https://t.me/KernelSU_group/27237/176515 https://t.me/KernelSU_group/3249/184908 tiann/KernelSU#955 (comment) OnlyTomInSecond/android_kernel_xiaomi_sdm845@03d233d tiann/KernelSU#1060 https://elixir.bootlin.com/linux/v5.9.1/source/fs/namespace.c#L1728 https://elixir.bootlin.com/linux/v5.10.9/source/fs/namespace.c#L1730 https://elixir.bootlin.com/linux/v6.5/source/fs/namespace.c#L1887 tiann/KernelSU#1464 (comment) Kernel side change examples 5.4 natsumerinchan/kernel_oneplus_sm8350@961d978 4.19 https://github.com/backslashxx/android_karnol_ximi_fog/commit/164917f56d0e75ab51bb9f1bdf489acac7a6d3db 4.14 crdroidandroid/android_kernel_xiaomi_sm6150@c07c70a 4.9 backslashxx/msm8953-kernel@195f075 4.4 https://github.com/riarumoda/android_kernel_samsung_a9y18qlte/commit/21ea33fe41ce079ec1d663c0bd2201bc00a8084a tiann/KernelSU#1464 (comment) ofcourse having someone on 3.18 confirm this will be nice. **PROS**: umount modules for everyone **CONS**: barrier of entry +1 --------- Co-authored-by: Christoph Hellwig <[email protected]> Co-authored-by: Fede2782 <[email protected]> Co-authored-by: Tom <[email protected]>
1 parent c7211aa commit eca3287

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/kernelsu/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,12 @@ $(info -- KernelSU Manager signature hash: $(KSU_EXPECTED_HASH))
5656
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)
5757
ccflags-y += -DEXPECTED_HASH=\"$(KSU_EXPECTED_HASH)\"
5858

59+
ifeq ($(shell grep -q "int path_umount" $(srctree)/fs/namespace.c; echo $$?),0)
60+
ccflags-y += -DKSU_UMOUNT
61+
else
62+
$(info -- Did you know you can backport path_umount to fs/namespace.c from 5.9?)
63+
$(info -- Read: https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#path_umount)
64+
endif
65+
5966
ccflags-y += -Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat
6067
ccflags-y += -Wno-declaration-after-statement -Wno-unused-function

drivers/kernelsu/core_hook.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static bool should_umount(struct path *path)
522522

523523
static void ksu_umount_mnt(struct path *path, int flags)
524524
{
525-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
525+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || KSU_UMOUNT
526526
int err = path_umount(path, flags);
527527
if (err) {
528528
pr_info("umount %s failed: %d\n", path->dentry->d_iname, err);

0 commit comments

Comments
 (0)