>From RFC5661, 18.36.3:
ca_maxoperations:
For the backchannel, the server MUST
NOT change the value the client offers. For the fore channel,
the server MAY change the requested value.
ca_maxrequests:
For the backchannel, the server MUST NOT change the
value the client offers. For the fore channel, the server MAY
change the requested value.
Signed-off-by: Vitaliy Gusev <[email protected]>
---
fs/nfs/nfs4proc.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5da5355..b144ec3 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5197,7 +5197,7 @@ static int nfs4_verify_fore_channel_attrs(struct nfs41_create_session_args *args
*/
if (rcvd->max_ops < sent->max_ops)
return -EINVAL;
- if (rcvd->max_reqs == 0)
+ if (rcvd->max_reqs == 0 || rcvd->max_reqs > NFS4_MAX_SLOT_TABLE)
return -EINVAL;
return 0;
}
@@ -5214,9 +5214,9 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached)
return -EINVAL;
/* These would render the backchannel useless: */
- if (rcvd->max_ops == 0)
+ if (rcvd->max_ops != sent->max_ops)
return -EINVAL;
- if (rcvd->max_reqs == 0)
+ if (rcvd->max_reqs != sent->max_reqs)
return -EINVAL;
return 0;
}
--
1.7.5.4
T24gV2VkLCAyMDEyLTAyLTE1IGF0IDE5OjM4ICswNDAwLCBWaXRhbGl5IEd1c2V2IHdyb3RlOg0K
PiA+RnJvbSBSRkM1NjYxLCAxOC4zNi4zOg0KPiANCj4gIGNhX21heG9wZXJhdGlvbnM6DQo+IA0K
PiAgICAgICBGb3IgdGhlIGJhY2tjaGFubmVsLCB0aGUgc2VydmVyIE1VU1QNCj4gICAgICAgTk9U
IGNoYW5nZSB0aGUgdmFsdWUgdGhlIGNsaWVudCBvZmZlcnMuICBGb3IgdGhlIGZvcmUgY2hhbm5l
bCwNCj4gICAgICAgdGhlIHNlcnZlciBNQVkgY2h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hdGljIGludCBuZnM0
X3ZlcmlmeV9iYWNrX2NoYW5uZWxfYXR0cnMoc3RydWN0IG5mczQxX2NyZWF0ZV9zZXNzaW9uX2Fy
Z3MgKmFyZ3MNCj4gIAlpZiAocmN2ZC0+bWF4X3Jlc3Bfc3pfY2FjaGVkID4gc2VudC0+bWF4X3Jl
c3Bfc3pfY2FjaGVkKQ0KPiAgCQlyZXR1cm4gLUVJTlZBTDsNCj4gIAkvKiBUaGVzZSB3b3VsZCBy
ZW5kZXIgdGhlIGJhY2tjaGFubmVsIHVzZWxlc3M6ICovDQo+IC0JaWYgKHJjdmQtPm1heF9vcHMg
ID09IDApDQo+ICsJaWYgKHJjdmQtPm1heF9vcHMgIT0gc2VudC0+bWF4X29wcykNCj4gIAkJcmV0
dXJuIC1FSU5WQUw7DQo+IC0JaWYgKHJjdmQtPm1heF9yZXFzID09IDApDQo+ICsJaWYgKHJjdmQt
Pm1heF9yZXFzICE9IHNlbnQtPm1heF9yZXFzKQ0KPiAgCQlyZXR1cm4gLUVJTlZBTDsNCg0KQUNL
IG9uIHRoaXMgaHVuay4uLg0KDQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xp
ZW50IG1haW50YWluZXINCg0KTmV0QXBwDQpUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbQ0Kd3d3
Lm5ldGFwcC5jb20NCg0K
>From RFC5661, 18.36.3:
ca_maxoperations:
For the backchannel, the server MUST
NOT change the value the client offers. For the fore channel,
the server MAY change the requested value.
ca_maxrequests:
For the backchannel, the server MUST NOT change the
value the client offers. For the fore channel, the server MAY
change the requested value.
Signed-off-by: Vitaliy Gusev <[email protected]>
---
fs/nfs/nfs4proc.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5da5355..233ed26 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5199,6 +5199,8 @@ static int nfs4_verify_fore_channel_attrs(struct nfs41_create_session_args *args
return -EINVAL;
if (rcvd->max_reqs == 0)
return -EINVAL;
+ if (rcvd->max_reqs > NFS4_MAX_SLOT_TABLE)
+ rcvd->max_reqs = NFS4_MAX_SLOT_TABLE;
return 0;
}
@@ -5214,9 +5216,9 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached)
return -EINVAL;
/* These would render the backchannel useless: */
- if (rcvd->max_ops == 0)
+ if (rcvd->max_ops != sent->max_ops)
return -EINVAL;
- if (rcvd->max_reqs == 0)
+ if (rcvd->max_reqs != sent->max_reqs)
return -EINVAL;
return 0;
}
--
1.7.5.4