From 34ebccb2e9cb984ae928a7289cb5829e6f335253 Mon Sep 17 00:00:00 2001 From: Chen Chengjun Date: Wed, 3 Dec 2025 05:09:12 +0000 Subject: [PATCH] Fix a bug of bind mount --- kernel/src/fs/path/mount.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/fs/path/mount.rs b/kernel/src/fs/path/mount.rs index 7cd21cfe2..24092eb16 100644 --- a/kernel/src/fs/path/mount.rs +++ b/kernel/src/fs/path/mount.rs @@ -326,7 +326,7 @@ impl Mount { let old_children = old_mount.children.read(); for old_child_mount in old_children.values() { let mountpoint = old_child_mount.mountpoint().unwrap(); - if !mountpoint.is_equal_or_descendant_of(old_mount.root_dentry()) { + if !mountpoint.is_equal_or_descendant_of(new_parent_mount.root_dentry()) { continue; } let new_child_mount =