[sheepdog] Unreliable error code handling in sheep/plainstore.c

Roy Yang bsdnet at outlook.com
Thu Mar 5 07:45:27 CET 2015


You are right. Errno in prealloc may be modified by sd_err before return.
Why sd_err sets errno --- mostly some library call  in dolog  will fail. Looks
there is a genuine problem. My concern is the easy way will hide the error 
or even some bug inside sd_err. But for now, looks your patch is the easiest 
to have the issue fixed.

Thanks,

Roy

Date: Thu, 5 Mar 2015 10:31:42 +0800
From: skypexu at gmail.com
To: bsdnet at outlook.com; mitake.hitoshi at gmail.com
CC: namei.unix at gmail.com; sheepdog at lists.wpkg.org
Subject: Re: [sheepdog] Unreliable error code handling in sheep/plainstore.c


  
    
  
  
    

    On 2015年03月04日 23:06, Roy Yang wrote:

    
    
      
      Thanks Hitoshi,

        

        It is a GNU C extension, and implicitly add  strerror (errno) .

        

        Since errno is used for system errors, should we modify it or

        we can solve the issue by just adjusting the order of sd_err and
        err_to_stderr?

        Just some thoughts, 

        

        Roy 

      
    
    

    Reorder seems can not fix all the cases, reading
    function utils.c:preallocate(), find that

    it calls sd_err(), the preallocate()  is used by
    plain_store.c:default_create_and_write(),

    and the possibly mucked errno is picked up and passed to
    err_to_sderr().

    

    

    

    

    
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20150304/7b9fadc1/attachment-0004.html>


More information about the sheepdog mailing list