From: Al Viro Date: Fri, 22 Aug 2025 17:07:43 +0000 (-0400) Subject: finish_automount(): simplify the ELOOP check X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=11941610b06820c4af7f1ff12071f159b3bf771d;p=users%2Fhch%2Fmisc.git 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 Signed-off-by: Al Viro --- diff --git a/fs/namespace.c b/fs/namespace.c index 86c6dd432b13..bdb33270ac6e 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; }