SUNRPC/backchanel: set XPT_CONG_CTRL flag for bc xprt
diff mbox

Message ID b321152e-cbe8-94b3-498c-1d32e7c7be2d@gmail.com
State New
Headers show

Commit Message

Kinglong Mee March 7, 2017, 9:22 a.m. UTC
The xprt for backchannel is created separately, not in TCP/UDP code.
Because without the flags, the requests from NFSv41 backchannel are
rejected in svc_process_common(),

1191         if (versp->vs_need_cong_ctrl &&
1192             !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags))
1193                 goto err_bad_vers;

Fixes: 5283b03ee5 ("nfs/nfsd/sunrpc: enforce transport...")
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 net/sunrpc/svcsock.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jeff Layton March 7, 2017, 11:11 a.m. UTC | #1
On Tue, 2017-03-07 at 17:22 +0800, Kinglong Mee wrote:
> The xprt for backchannel is created separately, not in TCP/UDP code.
> Because without the flags, the requests from NFSv41 backchannel are
> rejected in svc_process_common(),
> 
> 1191         if (versp->vs_need_cong_ctrl &&
> 1192             !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags))
> 1193                 goto err_bad_vers;
> 
> Fixes: 5283b03ee5 ("nfs/nfsd/sunrpc: enforce transport...")
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  net/sunrpc/svcsock.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> index 8931e33..2b720fa 100644
> --- a/net/sunrpc/svcsock.c
> +++ b/net/sunrpc/svcsock.c
> @@ -1635,6 +1635,7 @@ static struct svc_xprt *svc_bc_create_socket(struct svc_serv *serv,
>  
>  	xprt = &svsk->sk_xprt;
>  	svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv);
> +	set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
>  
>  	serv->sv_bc_xprt = xprt;
>  

Good catch.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. Bruce Fields March 9, 2017, 8:26 p.m. UTC | #2
Thanks!  Applying.--b.

On Tue, Mar 07, 2017 at 06:11:21AM -0500, Jeff Layton wrote:
> On Tue, 2017-03-07 at 17:22 +0800, Kinglong Mee wrote:
> > The xprt for backchannel is created separately, not in TCP/UDP code.
> > Because without the flags, the requests from NFSv41 backchannel are
> > rejected in svc_process_common(),
> > 
> > 1191         if (versp->vs_need_cong_ctrl &&
> > 1192             !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags))
> > 1193                 goto err_bad_vers;
> > 
> > Fixes: 5283b03ee5 ("nfs/nfsd/sunrpc: enforce transport...")
> > Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> > ---
> >  net/sunrpc/svcsock.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> > index 8931e33..2b720fa 100644
> > --- a/net/sunrpc/svcsock.c
> > +++ b/net/sunrpc/svcsock.c
> > @@ -1635,6 +1635,7 @@ static struct svc_xprt *svc_bc_create_socket(struct svc_serv *serv,
> >  
> >  	xprt = &svsk->sk_xprt;
> >  	svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv);
> > +	set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
> >  
> >  	serv->sv_bc_xprt = xprt;
> >  
> 
> Good catch.
> 
> Reviewed-by: Jeff Layton <jlayton@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benjamin Coddington March 10, 2017, 9:29 p.m. UTC | #3
On 9 Mar 2017, at 15:26, J. Bruce Fields wrote:

> Thanks!  Applying.--b.
>
> On Tue, Mar 07, 2017 at 06:11:21AM -0500, Jeff Layton wrote:
>> On Tue, 2017-03-07 at 17:22 +0800, Kinglong Mee wrote:
>>> The xprt for backchannel is created separately, not in TCP/UDP code.
>>> Because without the flags, the requests from NFSv41 backchannel are
>>> rejected in svc_process_common(),
>>>
>>> 1191         if (versp->vs_need_cong_ctrl &&
>>> 1192             !test_bit(XPT_CONG_CTRL, 
>>> &rqstp->rq_xprt->xpt_flags))
>>> 1193                 goto err_bad_vers;
>>>
>>> Fixes: 5283b03ee5 ("nfs/nfsd/sunrpc: enforce transport...")
>>> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>>> ---
>>>  net/sunrpc/svcsock.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
>>> index 8931e33..2b720fa 100644
>>> --- a/net/sunrpc/svcsock.c
>>> +++ b/net/sunrpc/svcsock.c
>>> @@ -1635,6 +1635,7 @@ static struct svc_xprt 
>>> *svc_bc_create_socket(struct svc_serv *serv,
>>>
>>>  	xprt = &svsk->sk_xprt;
>>>  	svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv);
>>> +	set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
>>>
>>>  	serv->sv_bc_xprt = xprt;
>>>
>>
>> Good catch.
>>
>> Reviewed-by: Jeff Layton <jlayton@redhat.com>

This one fixes my failing xfstests generic/089.  Thanks, Kinglong Mee.

Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Olga Kornievskaia March 31, 2017, 8:44 p.m. UTC | #4
Hey Bruce,

When is this going to go upstream?

On Thu, Mar 9, 2017 at 3:26 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> Thanks!  Applying.--b.
>
> On Tue, Mar 07, 2017 at 06:11:21AM -0500, Jeff Layton wrote:
>> On Tue, 2017-03-07 at 17:22 +0800, Kinglong Mee wrote:
>> > The xprt for backchannel is created separately, not in TCP/UDP code.
>> > Because without the flags, the requests from NFSv41 backchannel are
>> > rejected in svc_process_common(),
>> >
>> > 1191         if (versp->vs_need_cong_ctrl &&
>> > 1192             !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags))
>> > 1193                 goto err_bad_vers;
>> >
>> > Fixes: 5283b03ee5 ("nfs/nfsd/sunrpc: enforce transport...")
>> > Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>> > ---
>> >  net/sunrpc/svcsock.c | 1 +
>> >  1 file changed, 1 insertion(+)
>> >
>> > diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
>> > index 8931e33..2b720fa 100644
>> > --- a/net/sunrpc/svcsock.c
>> > +++ b/net/sunrpc/svcsock.c
>> > @@ -1635,6 +1635,7 @@ static struct svc_xprt *svc_bc_create_socket(struct svc_serv *serv,
>> >
>> >     xprt = &svsk->sk_xprt;
>> >     svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv);
>> > +   set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
>> >
>> >     serv->sv_bc_xprt = xprt;
>> >
>>
>> Good catch.
>>
>> Reviewed-by: Jeff Layton <jlayton@redhat.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. Bruce Fields April 1, 2017, 1:07 a.m. UTC | #5
On Fri, Mar 31, 2017 at 04:44:43PM -0400, Olga Kornievskaia wrote:
> Hey Bruce,
> 
> When is this going to go upstream?

I have it queued up for 4.11.  I'm hoping to send out a pull request
tonight, since I'll be taking most of next week off.

--b.

> 
> On Thu, Mar 9, 2017 at 3:26 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> > Thanks!  Applying.--b.
> >
> > On Tue, Mar 07, 2017 at 06:11:21AM -0500, Jeff Layton wrote:
> >> On Tue, 2017-03-07 at 17:22 +0800, Kinglong Mee wrote:
> >> > The xprt for backchannel is created separately, not in TCP/UDP code.
> >> > Because without the flags, the requests from NFSv41 backchannel are
> >> > rejected in svc_process_common(),
> >> >
> >> > 1191         if (versp->vs_need_cong_ctrl &&
> >> > 1192             !test_bit(XPT_CONG_CTRL, &rqstp->rq_xprt->xpt_flags))
> >> > 1193                 goto err_bad_vers;
> >> >
> >> > Fixes: 5283b03ee5 ("nfs/nfsd/sunrpc: enforce transport...")
> >> > Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> >> > ---
> >> >  net/sunrpc/svcsock.c | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> >
> >> > diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
> >> > index 8931e33..2b720fa 100644
> >> > --- a/net/sunrpc/svcsock.c
> >> > +++ b/net/sunrpc/svcsock.c
> >> > @@ -1635,6 +1635,7 @@ static struct svc_xprt *svc_bc_create_socket(struct svc_serv *serv,
> >> >
> >> >     xprt = &svsk->sk_xprt;
> >> >     svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv);
> >> > +   set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
> >> >
> >> >     serv->sv_bc_xprt = xprt;
> >> >
> >>
> >> Good catch.
> >>
> >> Reviewed-by: Jeff Layton <jlayton@redhat.com>
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 8931e33..2b720fa 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1635,6 +1635,7 @@  static struct svc_xprt *svc_bc_create_socket(struct svc_serv *serv,
 
 	xprt = &svsk->sk_xprt;
 	svc_xprt_init(net, &svc_tcp_bc_class, xprt, serv);
+	set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags);
 
 	serv->sv_bc_xprt = xprt;