From d711ab8b1f446a1627ad4b4081316425cd0631cc Mon Sep 17 00:00:00 2001 From: tiann Date: Wed, 12 Apr 2023 13:12:10 +0800 Subject: [PATCH] Revert "ksud: sort the stock mounts correctly." This reverts commit 273a0b0b9928a198ae0f5e040de989d540cf082f. --- userspace/ksud/src/mount.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/userspace/ksud/src/mount.rs b/userspace/ksud/src/mount.rs index c70811bd..75a4b3a9 100644 --- a/userspace/ksud/src/mount.rs +++ b/userspace/ksud/src/mount.rs @@ -259,10 +259,7 @@ impl StockMount { .destination_starts_with(std::path::Path::new(mnt)) .filter(|m| m.fstype != "overlay" && m.fstype != "rootfs") .collect::>(); - - // sort it by dest length, so we can mount it in order - // TODO: there are maybe submounts, we don't need to mount them, so we can skip them. - mounts.sort_by(|a, b| a.dest.as_os_str().len().cmp(&b.dest.as_os_str().len())); + mounts.sort_by(|a, b| b.dest.cmp(&a.dest)); // inverse order let mntroot = std::path::Path::new(crate::defs::STOCK_MNT_ROOT); utils::ensure_dir_exists(mntroot)?;