Just like most other file systems: get the simple checks out of the
way first.
Signed-off-by: Christoph Hellwig <hch@lst.de>
        int found = 0;
        int err;
 
+       if (dentry->d_name.len > NAME_MAX)
+               return ERR_PTR(-ENAMETOOLONG);
+
        /*
         * Fake invisibility if dir belongs to a group/default groups hierarchy
         * being attached
                 * If it doesn't exist and it isn't a NOT_PINNED item,
                 * it must be negative.
                 */
-               if (dentry->d_name.len > NAME_MAX)
-                       return ERR_PTR(-ENAMETOOLONG);
                d_add(dentry, NULL);
                return NULL;
        }