Re: [PATCH V2] Fix return value from fstat calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Aug 2021, Tkaczyk, Mariusz wrote:
> 
> Maybe It won't be useful for users but it may help developers to avoid
> trivial mistakes. As you told, if everything is fine then check is dead.
> In my opinion any error handling is better than nothing.

Error handling that is buggy, or that is hard to maintain is not better
than nothing.  If I can't guarantee that we never pass a bad file
descriptor, then you cannot guarantee that the error handling has no
bugs.   Less code generally means less bugs.

Any attempt to try to handle an error that should not be able to happen
other than crashing is fairly pointless - you cannot guess the real
cause, so you cannot know how to repair.  Just printing a message and
continuing could be as bad as not checking the error.

NeilBrown



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux