All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt()...
@ 2021-08-25 19:33 trondmy
  2021-08-25 19:51 ` Chuck Lever III
  0 siblings, 1 reply; 3+ messages in thread
From: trondmy @ 2021-08-25 19:33 UTC (permalink / raw)
  To: Chuck Lever, J.Bruce Fields; +Cc: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

If the attempt to reserve a slot fails, we currently leak the XPT_BUSY
flag on the socket. Among other things, this make it impossible to close
the socket.

Fixes: 82011c80b3ec ("SUNRPC: Move svc_xprt_received() call sites")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 net/sunrpc/svc_xprt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 5f0d33ca4bdb..b3cff4077899 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -975,7 +975,8 @@ static int svc_handle_xprt(struct svc_rqst *rqstp, struct svc_xprt *xprt)
 		rqstp->rq_stime = ktime_get();
 		rqstp->rq_reserved = serv->sv_max_mesg;
 		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
-	}
+	} else
+		svc_xprt_received(xprt);
 out:
 	trace_svc_handle_xprt(xprt, len);
 	return len;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt()...
  2021-08-25 19:33 [PATCH] SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt() trondmy
@ 2021-08-25 19:51 ` Chuck Lever III
  2021-08-25 20:37   ` Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever III @ 2021-08-25 19:51 UTC (permalink / raw)
  To: Trond Myklebust, Bruce Fields; +Cc: Linux NFS Mailing List



> On Aug 25, 2021, at 3:33 PM, trondmy@gmail.com wrote:
> 
> From: Trond Myklebust <trond.myklebust@hammerspace.com>
> 
> If the attempt to reserve a slot fails, we currently leak the XPT_BUSY
> flag on the socket. Among other things, this make it impossible to close
> the socket.
> 
> Fixes: 82011c80b3ec ("SUNRPC: Move svc_xprt_received() call sites")
> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> ---
> net/sunrpc/svc_xprt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
> index 5f0d33ca4bdb..b3cff4077899 100644
> --- a/net/sunrpc/svc_xprt.c
> +++ b/net/sunrpc/svc_xprt.c
> @@ -975,7 +975,8 @@ static int svc_handle_xprt(struct svc_rqst *rqstp, struct svc_xprt *xprt)
> 		rqstp->rq_stime = ktime_get();
> 		rqstp->rq_reserved = serv->sv_max_mesg;
> 		atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
> -	}
> +	} else
> +		svc_xprt_received(xprt);
> out:
> 	trace_svc_handle_xprt(xprt, len);
> 	return len;
> -- 
> 2.31.1

Looks correct. Bruce, perhaps you should pull this for 5.14-rc.
Linus says he expects to release 5.14-final this Sunday, fyi.

--
Chuck Lever




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt()...
  2021-08-25 19:51 ` Chuck Lever III
@ 2021-08-25 20:37   ` Bruce Fields
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Fields @ 2021-08-25 20:37 UTC (permalink / raw)
  To: Chuck Lever III; +Cc: Trond Myklebust, Linux NFS Mailing List

I wonder if this would explain
https://bugzilla.kernel.org/show_bug.cgi?id=213887.

On Wed, Aug 25, 2021 at 3:51 PM Chuck Lever III <chuck.lever@oracle.com> wrote:
>
>
>
> > On Aug 25, 2021, at 3:33 PM, trondmy@gmail.com wrote:
> >
> > From: Trond Myklebust <trond.myklebust@hammerspace.com>
> >
> > If the attempt to reserve a slot fails, we currently leak the XPT_BUSY
> > flag on the socket. Among other things, this make it impossible to close
> > the socket.
> >
> > Fixes: 82011c80b3ec ("SUNRPC: Move svc_xprt_received() call sites")
> > Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> > ---
> > net/sunrpc/svc_xprt.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
> > index 5f0d33ca4bdb..b3cff4077899 100644
> > --- a/net/sunrpc/svc_xprt.c
> > +++ b/net/sunrpc/svc_xprt.c
> > @@ -975,7 +975,8 @@ static int svc_handle_xprt(struct svc_rqst *rqstp, struct svc_xprt *xprt)
> >               rqstp->rq_stime = ktime_get();
> >               rqstp->rq_reserved = serv->sv_max_mesg;
> >               atomic_add(rqstp->rq_reserved, &xprt->xpt_reserved);
> > -     }
> > +     } else
> > +             svc_xprt_received(xprt);
> > out:
> >       trace_svc_handle_xprt(xprt, len);
> >       return len;
> > --
> > 2.31.1
>
> Looks correct. Bruce, perhaps you should pull this for 5.14-rc.
> Linus says he expects to release 5.14-final this Sunday, fyi.
>
> --
> Chuck Lever
>
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-25 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 19:33 [PATCH] SUNRPC: Fix XPT_BUSY flag leakage in svc_handle_xprt() trondmy
2021-08-25 19:51 ` Chuck Lever III
2021-08-25 20:37   ` 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.