linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] Add missing recording of back channel attrs in nfsd4_session
       [not found] <2BCCA4EF-9FCC-4320-85E1-AD500467C95D@gmail.com>
@ 2013-12-02 16:55 ` J. Bruce Fields
  2013-12-03  2:08   ` Kinglong Mee
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2013-12-02 16:55 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: bfields, linux-nfs

On Tue, Nov 26, 2013 at 10:25:20PM +0800, Kinglong Mee wrote:
> commit 5b6feee9608dce7afd2646f457c93e612526d1d8 forgot
> recording the back channel attrs in nfsd4_session.
> 
> nfsd just check the back channel attars by check_backchannel_attrs,
> but do not  record it in nfsd4_session in the latest kernel.

Whoops.  So the current server is returning random uninitialized data in
those fields, or all zeros?

It would be easy enough to write a pynfs test for this, I think.

--b.

> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  fs/nfsd/nfs4state.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 105d6fa..1aed9be 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -999,6 +999,8 @@ static void init_session(struct svc_rqst *rqstp, struct nfsd4_session *new, stru
>  	spin_unlock(&nn->client_lock);
>  	memcpy(&new->se_fchannel, &cses->fore_channel,
>  			sizeof(struct nfsd4_channel_attrs));
> +	memcpy(&new->se_bchannel, &cses->back_channel,
> +			sizeof(struct nfsd4_channel_attrs));
>  	if (cses->flags & SESSION4_BACK_CHAN) {
>  		struct sockaddr *sa = svc_addr(rqstp);
>  		/*
> -- 
> 1.8.1.4
> 

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

* Re: [PATCH] Add missing recording of back channel attrs in nfsd4_session
  2013-12-02 16:55 ` [PATCH] Add missing recording of back channel attrs in nfsd4_session J. Bruce Fields
@ 2013-12-03  2:08   ` Kinglong Mee
  2013-12-06 21:12     ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Kinglong Mee @ 2013-12-03  2:08 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: bfields, linux-nfs

On 12/03/2013 12:55 AM, J. Bruce Fields wrote:
> On Tue, Nov 26, 2013 at 10:25:20PM +0800, Kinglong Mee wrote:
>> commit 5b6feee9608dce7afd2646f457c93e612526d1d8 forgot
>> recording the back channel attrs in nfsd4_session.
>>
>> nfsd just check the back channel attars by check_backchannel_attrs,
>> but do not  record it in nfsd4_session in the latest kernel.
> 
> Whoops.  So the current server is returning random uninitialized data in
> those fields, or all zeros?
> 
> It would be easy enough to write a pynfs test for this, I think.

No, server returns right data for nfsd4_encode_create_session encoding
back-channel attrs from struct nfsd4_create_session, not from nfsd4_session.

Without this patch, se_bchannel in struct nfsd4_session contains data with all zeros.

thanks,
Kinglong Mee

>>
>> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>> ---
>>  fs/nfsd/nfs4state.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>> index 105d6fa..1aed9be 100644
>> --- a/fs/nfsd/nfs4state.c
>> +++ b/fs/nfsd/nfs4state.c
>> @@ -999,6 +999,8 @@ static void init_session(struct svc_rqst *rqstp, struct nfsd4_session *new, stru
>>  	spin_unlock(&nn->client_lock);
>>  	memcpy(&new->se_fchannel, &cses->fore_channel,
>>  			sizeof(struct nfsd4_channel_attrs));
>> +	memcpy(&new->se_bchannel, &cses->back_channel,
>> +			sizeof(struct nfsd4_channel_attrs));
>>  	if (cses->flags & SESSION4_BACK_CHAN) {
>>  		struct sockaddr *sa = svc_addr(rqstp);
>>  		/*
>> -- 
>> 1.8.1.4
>>
> 


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

* Re: [PATCH] Add missing recording of back channel attrs in nfsd4_session
  2013-12-03  2:08   ` Kinglong Mee
@ 2013-12-06 21:12     ` J. Bruce Fields
  2013-12-09  1:35       ` Kinglong Mee
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2013-12-06 21:12 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: bfields, linux-nfs

On Tue, Dec 03, 2013 at 10:08:59AM +0800, Kinglong Mee wrote:
> On 12/03/2013 12:55 AM, J. Bruce Fields wrote:
> > On Tue, Nov 26, 2013 at 10:25:20PM +0800, Kinglong Mee wrote:
> >> commit 5b6feee9608dce7afd2646f457c93e612526d1d8 forgot
> >> recording the back channel attrs in nfsd4_session.
> >>
> >> nfsd just check the back channel attars by check_backchannel_attrs,
> >> but do not  record it in nfsd4_session in the latest kernel.
> > 
> > Whoops.  So the current server is returning random uninitialized data in
> > those fields, or all zeros?
> > 
> > It would be easy enough to write a pynfs test for this, I think.
> 
> No, server returns right data for nfsd4_encode_create_session encoding
> back-channel attrs from struct nfsd4_create_session, not from nfsd4_session.
> 
> Without this patch, se_bchannel in struct nfsd4_session contains data with all zeros.

Oh, I see.

But actually we never use se_bchannel for anything.  Maybe the right
thing is just to remove that field from nfsd4_session.

--b.

> 
> thanks,
> Kinglong Mee
> 
> >>
> >> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> >> ---
> >>  fs/nfsd/nfs4state.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> >> index 105d6fa..1aed9be 100644
> >> --- a/fs/nfsd/nfs4state.c
> >> +++ b/fs/nfsd/nfs4state.c
> >> @@ -999,6 +999,8 @@ static void init_session(struct svc_rqst *rqstp, struct nfsd4_session *new, stru
> >>  	spin_unlock(&nn->client_lock);
> >>  	memcpy(&new->se_fchannel, &cses->fore_channel,
> >>  			sizeof(struct nfsd4_channel_attrs));
> >> +	memcpy(&new->se_bchannel, &cses->back_channel,
> >> +			sizeof(struct nfsd4_channel_attrs));
> >>  	if (cses->flags & SESSION4_BACK_CHAN) {
> >>  		struct sockaddr *sa = svc_addr(rqstp);
> >>  		/*
> >> -- 
> >> 1.8.1.4
> >>
> > 
> 

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

* Re: [PATCH] Add missing recording of back channel attrs in nfsd4_session
  2013-12-06 21:12     ` J. Bruce Fields
@ 2013-12-09  1:35       ` Kinglong Mee
  0 siblings, 0 replies; 4+ messages in thread
From: Kinglong Mee @ 2013-12-09  1:35 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: bfields, linux-nfs

2013/12/7 J. Bruce Fields <bfields@fieldses.org>:
> On Tue, Dec 03, 2013 at 10:08:59AM +0800, Kinglong Mee wrote:
>> On 12/03/2013 12:55 AM, J. Bruce Fields wrote:
>> > On Tue, Nov 26, 2013 at 10:25:20PM +0800, Kinglong Mee wrote:
>> >> commit 5b6feee9608dce7afd2646f457c93e612526d1d8 forgot
>> >> recording the back channel attrs in nfsd4_session.
>> >>
>> >> nfsd just check the back channel attars by check_backchannel_attrs,
>> >> but do not  record it in nfsd4_session in the latest kernel.
>> >
>> > Whoops.  So the current server is returning random uninitialized data in
>> > those fields, or all zeros?
>> >
>> > It would be easy enough to write a pynfs test for this, I think.
>>
>> No, server returns right data for nfsd4_encode_create_session encoding
>> back-channel attrs from struct nfsd4_create_session, not from nfsd4_session.
>>
>> Without this patch, se_bchannel in struct nfsd4_session contains data with all zeros.
>
> Oh, I see.
>
> But actually we never use se_bchannel for anything.  Maybe the right
> thing is just to remove that field from nfsd4_session.

I'd like keep it in nfsd4_session.
Maybe nfsd will use it after a while.

thanks,
Kinglong Mee
>>
>> >>
>> >> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>> >> ---
>> >>  fs/nfsd/nfs4state.c | 2 ++
>> >>  1 file changed, 2 insertions(+)
>> >>
>> >> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>> >> index 105d6fa..1aed9be 100644
>> >> --- a/fs/nfsd/nfs4state.c
>> >> +++ b/fs/nfsd/nfs4state.c
>> >> @@ -999,6 +999,8 @@ static void init_session(struct svc_rqst *rqstp, struct nfsd4_session *new, stru
>> >>    spin_unlock(&nn->client_lock);
>> >>    memcpy(&new->se_fchannel, &cses->fore_channel,
>> >>                    sizeof(struct nfsd4_channel_attrs));
>> >> +  memcpy(&new->se_bchannel, &cses->back_channel,
>> >> +                  sizeof(struct nfsd4_channel_attrs));
>> >>    if (cses->flags & SESSION4_BACK_CHAN) {
>> >>            struct sockaddr *sa = svc_addr(rqstp);
>> >>            /*
>> >> --
>> >> 1.8.1.4
>> >>
>> >
>>

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

end of thread, other threads:[~2013-12-09  1:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2BCCA4EF-9FCC-4320-85E1-AD500467C95D@gmail.com>
2013-12-02 16:55 ` [PATCH] Add missing recording of back channel attrs in nfsd4_session J. Bruce Fields
2013-12-03  2:08   ` Kinglong Mee
2013-12-06 21:12     ` J. Bruce Fields
2013-12-09  1:35       ` Kinglong Mee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).