aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-08-22 13:07:43 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2025-09-02 19:35:58 -0400
commit11941610b06820c4af7f1ff12071f159b3bf771d (patch)
treec794eba0b07aa81304975aef005f26a23ee2f115 /fs/namespace.c
parentd29da1a8f119130e6fc7d5d71029d402dabe2cb0 (diff)
downloadrandom-11941610b06820c4af7f1ff12071f159b3bf771d.tar.gz
finish_automount(): simplify the ELOOP check
It's enough to check that dentries match; if path->dentry is equal to m->mnt_root, superblocks will match as well. Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 86c6dd432b13cf..bdb33270ac6e3d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3798,8 +3798,7 @@ int finish_automount(struct vfsmount *m, const struct path *path)
mnt = real_mount(m);
- if (m->mnt_sb == path->mnt->mnt_sb &&
- m->mnt_root == dentry) {
+ if (m->mnt_root == path->dentry) {
err = -ELOOP;
goto discard;
}