Skip to content

Commit

Permalink
kernel: suggest non-gki kernel users to backport path_umount
Browse files Browse the repository at this point in the history
Most non-gki kernel builders have to touch their kernel source code anyway.
Tell them to backport path_umount, spread the news so they can benefit.

Discussion: #1464
Co-Authored-By: Fede2782 <[email protected]>
Co-Authored-By: backslashxx <[email protected]>
Co-Authored-By: Tom <[email protected]>
  • Loading branch information
3 people committed Mar 18, 2024
1 parent 6281b85 commit 7cc8108
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ $(info -- KernelSU Manager signature hash: $(KSU_EXPECTED_HASH))
ccflags-y += -DEXPECTED_SIZE=$(KSU_EXPECTED_SIZE)
ccflags-y += -DEXPECTED_HASH=\"$(KSU_EXPECTED_HASH)\"

ifeq ($(shell grep -q "int path_umount" $(srctree)/fs/namespace.c; echo $$?),0)
ccflags-y += -DKSU_UMOUNT
else
$(info -- Did you know you can backport path_umount to fs/namespace.c from 5.9?)
$(info -- Read: https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#path_umount)
endif

ccflags-y += -Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-int-conversion -Wno-gcc-compat
ccflags-y += -Wno-declaration-after-statement -Wno-unused-function

Expand Down
2 changes: 1 addition & 1 deletion kernel/core_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static bool should_umount(struct path *path)

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

0 comments on commit 7cc8108

Please sign in to comment.