| Previous | Next |
| ENOLCK | EMSGSIZE |
ELOOP
Two meanings of the same errno
ELOOP usually means that resolving a pathname followed too many symbolic links, often because one link eventually points back to an earlier location. Linux limits the number of symlink traversals during path resolution, so a very long acyclic chain can fail as well. The error can also be intentional: open() with O_NOFOLLOW may use it to reject a symbolic link in the final path component.
This makes the error useful for security-sensitive code. A service that accepts path input should not “fix” it by silently following more links or stripping prefixes. That can turn a malformed path into a path traversal problem, especially in writable directories shared with less-trusted users.
What to inspect
- Resolve links component by component and preserve the chain in logs without exposing sensitive path data unnecessarily.
- Check deployment symlinks, release pointers, mount aliases, and generated cache paths for cycles.
- Use directory file descriptors and explicit no-symlink resolution policies when an operation must remain beneath a trusted root.
- Treat an
O_NOFOLLOWfailure as a policy result, not as a transient filesystem error.
References
Looking for a different code? Search another status or error code.