Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mount: start iterating from start of rbtree

If the root of the namespace has an id that's greater than the child
we'd not find it. Handle that case.

Link: https://patch.msgid.link/20260122-work-fsmount-namespace-v1-1-5ef0a886e646@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+6 -6
+6 -6
fs/namespace.c
··· 5649 5649 if (mnt_ns_empty(ns)) 5650 5650 return -ENOENT; 5651 5651 5652 - first = child = ns->root; 5653 - for (;;) { 5654 - child = listmnt_next(child, false); 5655 - if (!child) 5656 - return -ENOENT; 5657 - if (child->mnt_parent == first) 5652 + first = ns->root; 5653 + for (child = node_to_mount(ns->mnt_first_node); child; 5654 + child = listmnt_next(child, false)) { 5655 + if (child != first && child->mnt_parent == first) 5658 5656 break; 5659 5657 } 5658 + if (!child) 5659 + return -ENOENT; 5660 5660 5661 5661 root->mnt = mntget(&child->mnt); 5662 5662 root->dentry = dget(root->mnt->mnt_root);