sunrpc: only call test_bit once in svc_xprt_received
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- net/sunrpc/svc_xprt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/sunrpc/svc_xprt.c +4 -2
@@ -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: */
Signature · 1 line
2.1.0
Quoted 2 lines · Jeff Layton
...move the
WARN_ON_ONCEinside the following if block since they use the same condition.
Thanks, applying for 3.19
--b.
Quoted 27 lines
Signed-off-by Jeff Layton <[email protected]>--- net/sunrpc/svc_xprt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)net/sunrpc/svc_xprt.c +4
-2@@ -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: */ Signature · 1 line
2.1.0