Subject: Re: [PATCH net-next] switchdev: fix BUG when port driver doesn't support set attr op

From: David Ahern <[email-masked]>
Date: Wed, 10 Jun 2015 15:51:28 -0600

On 6/10/15 3:47 PM, Scott Feldman wrote:
>> Should that be WARN_ON instead of BUG_ON?
>
> I think I had it as WARN when we were working on the initial patches,
> but we changed it to BUG_ON because we should only get an error here
> if the driver screwed something up between PREPARE phase and COMMIT
> phase, so it should be considered a driver bug which needs fixing.
>

Linus rants from time to time about the prolific use of BUG_ON. e.g.,
     https://lkml.org/lkml/2015/4/28/528

'BUG_ON() is for things where our internal data structures are so 
corrupted that we don't know what to do, and there's no way to continue. 
Not for "I want to sprinkle these things around and this should not 
happen".'

David