diff --git a/kernel/umount_manager.c b/kernel/umount_manager.c index a3c3ac74..b6465ea0 100644 --- a/kernel/umount_manager.c +++ b/kernel/umount_manager.c @@ -109,6 +109,9 @@ int ksu_umount_manager_add(const char *path, bool check_mnt, int flags, bool is_ unsigned long irqflags; int ret = 0; + if (flags == -1) + flags = MNT_DETACH; + if (!path || strlen(path) == 0 || strlen(path) >= 256) { return -EINVAL; } diff --git a/userspace/ksud/src/cli.rs b/userspace/ksud/src/cli.rs index ce67a6cb..b88aa4f3 100644 --- a/userspace/ksud/src/cli.rs +++ b/userspace/ksud/src/cli.rs @@ -361,7 +361,7 @@ enum Umount { check_mnt: bool, /// Umount flags (0 or 8 for MNT_DETACH) - #[arg(long, default_value = "0")] + #[arg(long, default_value = "-1")] flags: i32, }, diff --git a/userspace/ksud/src/umount_manager.rs b/userspace/ksud/src/umount_manager.rs index e30a76cf..5f9627e4 100644 --- a/userspace/ksud/src/umount_manager.rs +++ b/userspace/ksud/src/umount_manager.rs @@ -87,7 +87,11 @@ impl UmountManager { } pub fn add_entry(&mut self, path: &str, check_mnt: bool, flags: i32) -> Result<()> { - let exists = self.defaults.iter().chain(&self.config.entries).any(|e| e.path == path); + let exists = self + .defaults + .iter() + .chain(&self.config.entries) + .any(|e| e.path == path); if exists { return Err(anyhow!("Entry already exists: {}", path)); } @@ -166,7 +170,7 @@ impl UmountManager { UmountEntry { path: "/data/adb/modules".to_string(), check_mnt: false, - flags: 0x00000002, // MNT_DETACH + flags: -1, is_default: true, }, ]