-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use internal error codes instead of UNIX errnos #280
Copy link
Copy link
Closed
Labels
DocApprovedMandatory flag to pass smoke. Provide user facing document to get approval.Mandatory flag to pass smoke. Provide user facing document to get approval.FA: Debug-ability & QualityFA: Scalability ImprovementsFA: Technical DebtFA: Usability & SupportabilityPrio: MediumSpecApprovedThis is a mandatory flag for passing the smoke for feature. Provide spec of feature to get approvalThis is a mandatory flag for passing the smoke for feature. Provide spec of feature to get approvalType:EnhancementwontfixManaged by stale[bot]Managed by stale[bot]
Milestone
Metadata
Metadata
Assignees
Labels
DocApprovedMandatory flag to pass smoke. Provide user facing document to get approval.Mandatory flag to pass smoke. Provide user facing document to get approval.FA: Debug-ability & QualityFA: Scalability ImprovementsFA: Technical DebtFA: Usability & SupportabilityPrio: MediumSpecApprovedThis is a mandatory flag for passing the smoke for feature. Provide spec of feature to get approvalThis is a mandatory flag for passing the smoke for feature. Provide spec of feature to get approvalType:EnhancementwontfixManaged by stale[bot]Managed by stale[bot]
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.