[dm-devel] dm-integrity: fix inefficient allocation of stack space

John Stoffel john at stoffel.org
Thu Jul 20 15:46:34 UTC 2017


>>>>> "Mikulas" == Mikulas Patocka <mpatocka at redhat.com> writes:

Mikulas> On Wed, 19 Jul 2017, John Stoffel wrote:

>> I'd like to argue that you should never use BUG_ON at all, esp since
>> if you have integrity running on just one critical device, but have
>> other devices that work just fine, bringing down the entire system
>> because you don't think things are ok is terrible.
>> 
>> We should rip out ALL the BUG_ONs in the dm-integrity and just do
>> proper error handling instead.  For testing, sure, use them on your
>> code.  But please, not for general use!
>> 
>> John

Mikulas> Linus sometimes argued against BUG_ON and people are
Mikulas> repeating it after him like sheep.

I understand Linus' rants on BUG_ON and I agree with them.  He doesn't
argue that they're not appropriate at times, but just using them
because a random driver or module freaks out is NOT appropriate.  

Mikulas> If a programmer made a bug in his code, he should fix that
Mikulas> bug, not write additional recovery code for the bug.

If a programmer has a bug which kills the system for no damn good
reason, then I object.  Don't think that dm-integrity is oh so
important that you need to kill the system because of a mistake.

Try to be robust.  90% of all code is error handling.

John




More information about the dm-devel mailing list