Skip to contentSkip to conversation

Add missing recording of back channel attrs in nfsd4_session

PATCH J. Bruce Fields 2 participants 4 messages Dec 2, 2013 – Dec 9, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 5 lines · Kinglong Mee

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.

Quoted 22 lines
---
 fs/nfsd/nfs4state.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfsd/nfs4state.c +2 -0
index 105d6fa..1aed9be 100644
@@ -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);
 		/*
Signature · 1 line
1.8.1.4
#2 lore raw
Quoted 11 lines · J. Bruce Fields
Quoted 5 lines · Kinglong Mee

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

Quoted 23 lines
Quoted 22 lines
---
 fs/nfsd/nfs4state.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfsd/nfs4state.c +2 -0
index 105d6fa..1aed9be 100644
@@ -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);
 		/*
Signature · 1 line
1.8.1.4
#3 lore raw
Quoted 11 lines · Kinglong Mee
Quoted 10 lines · J. Bruce Fields
Quoted 5 lines · Kinglong Mee

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?

Quoted 6 lines
Quoted 1 line

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.

Quoted 28 lines

thanks,
Kinglong Mee

Quoted 23 lines
Quoted 22 lines
---
 fs/nfsd/nfs4state.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfsd/nfs4state.c +2 -0
index 105d6fa..1aed9be 100644
@@ -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);
 		/*
Signature · 1 line
1.8.1.4
#4 lore raw

2013/12/7 J. Bruce Fields <[email protected]>:

Quoted 17 lines · Kinglong Mee
Quoted 16 lines · J. Bruce Fields
Quoted 11 lines · Kinglong Mee
Quoted 5 lines

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.

Quoted 6 lines
Quoted 1 line

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

Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 23 lines
---
 fs/nfsd/nfs4state.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nfsd/nfs4state.c +2 -1
index 105d6fa..1aed9be 100644
@@ -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