]> www.infradead.org Git - users/hch/misc.git/commitdiff
finish_automount(): simplify the ELOOP check
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 22 Aug 2025 17:07:43 +0000 (13:07 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 2 Sep 2025 23:35:58 +0000 (19:35 -0400)
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>
fs/namespace.c

index 86c6dd432b13cf45bb82da8173f0d91e583887d9..bdb33270ac6e3d6972e29bf6914a578c1e7fc5a7 100644 (file)
@@ -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;
        }