[Gluster-devel] [Feedback] Error codes instead of errnos

Amar Tumballi atumball at redhat.com
Mon Sep 4 10:18:58 UTC 2017


Jeff had opened a github issue #280 [1] regarding the $subject, and we were
discussing some possibilities, and discussed below in github. I am cross
posting it here so it can catch more eyes.

------

Solution proposal.

Some basic possibilities:

   - Convert errno to error-code in syscall.h itself, so any code inside
   glusterfs, we only deal with error code. (ie, from posix itself, errno
   won't exist, but error-code).
   - Convert back to errno in interface layer like fuse/gfapi.

To do this, we need an interface, where give a errno, we need a
corresponding error-code. And given an error-code, we need what errno it
is, and possible error message to log for the given error code.

Currently, the implementation in 'experimental' branch is to have all this
taken care in compat-errno.{c,h}. Further feedback welcome.
More possibiities?

   - For more strict check, we can change the signature to enum of
   error-code, so we will be able to enforce people to use it.

Challenges

   - Need contributions from almost every component owners to help make
   this change.
   - Merging this would make most of the patches in queue as 'Merge
   Conflict' state.
   - The changes to enum can't be done as multiple patches as the smoke and
   regressions will fail in compilation itself without all the required
   changes, so it will be one BIG change (at least 5000 lines diff). Need a
   quicker action with reviews.
   - Again, because it has be ONE patch, co-ordination in any current
   gluster branches (even experimental) would be hard, so we need to work with
   a developers personal branch, and then do git rebase -i (and squash).

Calls for a half-day hackathon for all the maintainers/peers and other
contributors!

Feedbacks welcome!
----------------


If the main logic, and changes to `compat-errno.{c.h}` are fine, I would
like to hear about possibilities of a hackathon for getting the code-base
walk through for changing errno to error code (and also possible new
addition to error codes if it makes sense).

Regards,
Amar

-- 
Amar Tumballi (amarts)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20170904/85272075/attachment.html>


More information about the Gluster-devel mailing list