Skip to content

Commit

Permalink
sunrpc: only call test_bit once in svc_xprt_received
Browse files Browse the repository at this point in the history
...move the WARN_ON_ONCE inside the following if block since they use
the same condition.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Dec 9, 2014
1 parent ef17af2 commit acf06a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
*/
Expand Down

0 comments on commit acf06a7

Please sign in to comment.