* [PATCH] sunrpc: only call test_bit once in svc_xprt_received
@ 2014-12-01 18:45 Jeff Layton
2014-12-08 16:59 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2014-12-01 18:45 UTC (permalink / raw)
To: bfields; +Cc: linux-nfs
...move the WARN_ON_ONCE inside the following if block since they use
the same condition.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
---
net/sunrpc/svc_xprt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 0ae1d78d934d..40ecda40c2ec 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:
*/
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sunrpc: only call test_bit once in svc_xprt_received
2014-12-01 18:45 [PATCH] sunrpc: only call test_bit once in svc_xprt_received Jeff Layton
@ 2014-12-08 16:59 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2014-12-08 16:59 UTC (permalink / raw)
To: Jeff Layton; +Cc: linux-nfs
On Mon, Dec 01, 2014 at 01:45:24PM -0500, Jeff Layton wrote:
> ...move the WARN_ON_ONCE inside the following if block since they use
> the same condition.
Thanks, applying for 3.19
--b.
>
> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> ---
> net/sunrpc/svc_xprt.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
> index 0ae1d78d934d..40ecda40c2ec 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:
> */
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-08 16:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-01 18:45 [PATCH] sunrpc: only call test_bit once in svc_xprt_received Jeff Layton
2014-12-08 16:59 ` J. Bruce Fields
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.