Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-25 Thread Jeff Layton
On Tue, 2017-10-24 at 15:12 -0500, Gustavo A. R. Silva wrote: > Quoting "J. Bruce Fields" : > > > On Tue, Oct 24, 2017 at 02:18:52PM -0400, Jeff Layton wrote: > > > On Tue, 2017-10-24 at 13:53 -0400, J. Bruce Fields wrote: > > > > On Tue, Oct 24, 2017 at 01:26:49PM -0400, Weston Andros Adamson wro

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Gustavo A. R. Silva
Quoting "J. Bruce Fields" : On Tue, Oct 24, 2017 at 02:18:52PM -0400, Jeff Layton wrote: On Tue, 2017-10-24 at 13:53 -0400, J. Bruce Fields wrote: > On Tue, Oct 24, 2017 at 01:26:49PM -0400, Weston Andros Adamson wrote: > > Is there a reason to BUG() in these places? Couldn't we WARN_ON_ONCE

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread J. Bruce Fields
On Tue, Oct 24, 2017 at 02:18:52PM -0400, Jeff Layton wrote: > On Tue, 2017-10-24 at 13:53 -0400, J. Bruce Fields wrote: > > On Tue, Oct 24, 2017 at 01:26:49PM -0400, Weston Andros Adamson wrote: > > > Is there a reason to BUG() in these places? Couldn't we WARN_ON_ONCE and > > > return an error?

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Jeff Layton
On Tue, 2017-10-24 at 13:53 -0400, J. Bruce Fields wrote: > On Tue, Oct 24, 2017 at 01:26:49PM -0400, Weston Andros Adamson wrote: > > Is there a reason to BUG() in these places? Couldn't we WARN_ON_ONCE and > > return an error? > > I think the BUG() will just kill an nfsd thread that isn't holdi

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread J. Bruce Fields
On Tue, Oct 24, 2017 at 01:26:49PM -0400, Weston Andros Adamson wrote: > Is there a reason to BUG() in these places? Couldn't we WARN_ON_ONCE and > return an error? I think the BUG() will just kill an nfsd thread that isn't holding any interesting locks. The failures look unlikely. (Except for

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-24 Thread Weston Andros Adamson
Is there a reason to BUG() in these places? Couldn't we WARN_ON_ONCE and return an error? -dros > On Oct 23, 2017, at 4:31 PM, J. Bruce Fields wrote: > > In the past we've avoided BUG_ON(X) where X might have side effects, on > the theory that it should actually be OK just to compile out BUG_O

Re: [PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread J. Bruce Fields
In the past we've avoided BUG_ON(X) where X might have side effects, on the theory that it should actually be OK just to compile out BUG_ON()s. Has that changed? In any case, I don't find that this improves readability; dropping. --b. On Mon, Oct 23, 2017 at 01:16:35PM -0500, Gustavo A. R. Silva

[PATCH] net: sunrpc: svcauth_gss: use BUG_ON instead of if condition followed by BUG

2017-10-23 Thread Gustavo A. R. Silva
Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- net/sunrpc/auth_gss/svcauth_gss.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net