Skip to content

Commit dadb9f5

Browse files
backslashxxTrijal08
authored andcommitted
kernel: core_hook: tweak and rename path_umount handler
rename function to ksu_path_umount to clearly differntiate it from sys_umount. Pass mnt string directly to avoid redundant resolution for debug logging. Small touches, to make it neater. Signed-off-by: backslashxx <[email protected]>
1 parent dea14b8 commit dadb9f5

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

kernel/core_hook.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -564,14 +564,10 @@ static bool should_umount(struct path *path)
564564
}
565565

566566
#ifdef KSU_HAS_PATH_UMOUNT
567-
static int ksu_umount_mnt(struct path *path, int flags)
567+
static void ksu_path_umount(const char *mnt, struct path *path, int flags)
568568
{
569-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || defined(KSU_UMOUNT)
570-
return path_umount(path, flags);
571-
#else
572-
// TODO: umount for non GKI kernel
573-
return -ENOSYS;
574-
#endif
569+
int err = path_umount(path, flags);
570+
pr_info("%s: path: %s code: %d\n", __func__, mnt, err);
575571
}
576572
#else
577573
static void ksu_sys_umount(const char *mnt, int flags)
@@ -609,13 +605,10 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
609605
}
610606

611607
#ifdef KSU_HAS_PATH_UMOUNT
612-
err = ksu_umount_mnt(&path, flags);
608+
ksu_path_umount(mnt, &path, flags);
613609
#else
614-
err = ksu_sys_umount(mnt, flags);
610+
ksu_sys_umount(mnt, flags);
615611
#endif
616-
if (err) {
617-
pr_warn("umount %s failed: %d\n", mnt, err);
618-
}
619612
}
620613

621614
int ksu_handle_setuid(struct cred *new, const struct cred *old)

0 commit comments

Comments
 (0)