Skip to content

Use internal error codes instead of UNIX errnos #280

@jdarcy

Description

@jdarcy

Over the years we've had many problems with the meaning of various UNIX errnos being overloaded, usually because some subsystem uses a particular error code internally. An ESTALE generated internally means something different than an ESTALE from a posix syscall. ENOTCONN has too many different meanings even to keep track of. There are also portability issues when a particular errno value doesn't exist or has a different meaning on NetBSD/FreeBSD than on Linux. Using an internal error type instead of overloading random errno values with random meanings will help avoid both problems.

My proposal is to have our own set of error values, and only use those internally. Whenever we need to convert back and forth - e.g. from a syscall/libc errno to an internal gf_errno or in the opposite direction when reporting errors via FUSE/NFS - we can use a conversion table by default, but there might also be many cases where this default needs to be overridden.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions