kernel: Fix misleading log

This commit is contained in:
weishu
2024-03-27 17:28:46 +08:00
parent c9d8c62497
commit 4ac203a78d

View File

@@ -438,15 +438,13 @@ static bool should_umount(struct path *path)
return false; return false;
} }
static void ksu_umount_mnt(struct path *path, int flags) static int ksu_umount_mnt(struct path *path, int flags)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || defined(KSU_UMOUNT) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) || defined(KSU_UMOUNT)
int err = path_umount(path, flags); return path_umount(path, flags);
if (err) {
pr_info("umount %s failed: %d\n", path->dentry->d_iname, err);
}
#else #else
// TODO: umount for non GKI kernel // TODO: umount for non GKI kernel
return -ENOSYS
#endif #endif
} }
@@ -468,7 +466,10 @@ static void try_umount(const char *mnt, bool check_mnt, int flags)
return; return;
} }
ksu_umount_mnt(&path, flags); err = ksu_umount_mnt(&path, flags);
if (err) {
pr_warn("umount %s failed: %d\n", mnt, err);
}
} }
int ksu_handle_setuid(struct cred *new, const struct cred *old) int ksu_handle_setuid(struct cred *new, const struct cred *old)