From: Jeff Layton Date: Mon, 1 Dec 2014 18:45:24 +0000 (-0500) Subject: sunrpc: only call test_bit once in svc_xprt_received X-Git-Tag: v5.15~16658^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acf06a7fa12070abb3eab24fc4bc30e361a7c416;p=platform%2Fkernel%2Flinux-starfive.git sunrpc: only call test_bit once in svc_xprt_received ...move the WARN_ON_ONCE inside the following if block since they use the same condition. Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 73d40bd..c69358b 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -220,9 +220,11 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, */ static void svc_xprt_received(struct svc_xprt *xprt) { - WARN_ON_ONCE(!test_bit(XPT_BUSY, &xprt->xpt_flags)); - if (!test_bit(XPT_BUSY, &xprt->xpt_flags)) + if (!test_bit(XPT_BUSY, &xprt->xpt_flags)) { + WARN_ONCE(1, "xprt=0x%p already busy!", xprt); return; + } + /* As soon as we clear busy, the xprt could be closed and * 'put', so we need a reference to call svc_xprt_do_enqueue with: */