Merge tag 'vfs-6.9.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[linux-2.6-microblaze.git] / fs / namei.c
index 9342fa6..d0c4a3e 100644 (file)
@@ -2680,10 +2680,8 @@ static int lookup_one_common(struct mnt_idmap *idmap,
        if (!len)
                return -EACCES;
 
-       if (unlikely(name[0] == '.')) {
-               if (len < 2 || (len == 2 && name[1] == '.'))
-                       return -EACCES;
-       }
+       if (is_dot_dotdot(name, len))
+               return -EACCES;
 
        while (len--) {
                unsigned int c = *(const unsigned char *)name++;