From 51bc27a869ba1a34913e31cddd735b930069a433 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 15 Jan 2021 02:23:53 -0800 Subject: [PATCH] Avoid F2FS like a plague --- native/jni/init/mount.cpp | 6 +++--- scripts/util_functions.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/native/jni/init/mount.cpp b/native/jni/init/mount.cpp index e9f33c079..a4d020087 100644 --- a/native/jni/init/mount.cpp +++ b/native/jni/init/mount.cpp @@ -228,9 +228,9 @@ void MagiskInit::mount_rules_dir(const char *dev_base, const char *mnt_base) { if (setup_block(false) < 0) goto cache; } - // Try to mount with either ext4 or f2fs - // Failure means either FDE or metadata encryption - if (!do_mount("ext4") && !do_mount("f2fs")) + // WARNING: DO NOT ATTEMPT TO MOUNT F2FS AS IT MAY CRASH THE KERNEL + // Failure means either f2fs, FDE, or metadata encryption + if (!do_mount("ext4")) goto cache; strcpy(p, "/data/unencrypted"); diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 7e1ae47e5..f26631639 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -608,7 +608,7 @@ copy_sepolicy_rules() { local active_dir=$(magisk --path)/.magisk/mirror/sepolicy.rules if [ -e $active_dir ]; then RULESDIR=$(readlink -f $active_dir) - elif [ -d /data/unencrypted ] && ! grep ' /data ' /proc/mounts | grep -q 'dm-'; then + elif [ -d /data/unencrypted ] && ! grep ' /data ' /proc/mounts | grep -qE 'dm-|f2fs'; then RULESDIR=/data/unencrypted/magisk elif grep -q ' /cache ' /proc/mounts; then RULESDIR=/cache/magisk