The server may return NFS4ERR_NOSPC during NFSv4.1+ mount if there is a
memory pressure to allocate a DRC slot for session being created. In
such cases, try with lower nfs versions, which may succeed as DRC is
shared by clients.
Signed-off-by: Manjunath Patil <[email protected]>
---
utils/mount/stropts.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index d1b0708..7e97a88 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -881,6 +881,10 @@ check_result:
case EINVAL:
/* A less clear indication that our client
* does not support NFSv4 minor version. */
+ case ENOSPC:
+ /* Server returned NFS4ERR_NOSPC for create session [NFSv4.1+].
+ * Try with lower NFS versions which share DRC amoung clients and
+ * hence low memory may be ok. */
case EACCES:
/* An unclear indication that the server
* may not support NFSv4 minor version. */
--
1.8.3.1
T24gVGh1LCAyMDE4LTA2LTIxIGF0IDA5OjM0IC0wNzAwLCBNYW5qdW5hdGggUGF0aWwgd3JvdGU6
DQo+IFRoZSBzZXJ2ZXIgbWF5IHJldHVybiBORlM0RVJSX05PU1BDIGR1cmluZyBORlN2NC4xKyBt
b3VudCBpZiB0aGVyZSBpcw0KPiBhDQo+IG1lbW9yeSBwcmVzc3VyZSB0byBhbGxvY2F0ZSBhIERS
QyBzbG90IGZvciBzZXNzaW9uIGJlaW5nIGNyZWF0ZWQuIEluDQo+IHN1Y2ggY2FzZXMsIHRyeSB3
aXRoIGxvd2VyIG5mcyB2ZXJzaW9ucywgd2hpY2ggbWF5IHN1Y2NlZWQgYXMgRFJDIGlzDQo+IHNo
YXJlZCBieSBjbGllbnRzLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogTWFuanVuYXRoIFBhdGlsIDxt
YW5qdW5hdGguYi5wYXRpbEBvcmFjbGUuY29tPg0KPiAtLS0NCj4gIHV0aWxzL21vdW50L3N0cm9w
dHMuYyB8IDQgKysrKw0KPiAgMSBmaWxlIGNoYW5nZWQsIDQgaW5zZXJ0aW9ucygrKQ0KPiANCj4g
ZGlmZiAt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NlZSBDQl9SRUNB
TExfU0xPVCkuDQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xpZW50IG1haW50
YWluZXIsIEhhbW1lcnNwYWNlDQp0cm9uZC5teWtsZWJ1c3RAaGFtbWVyc3BhY2UuY29tDQoNCg==
On 06/21/2018 12:59 PM, Trond Myklebust wrote:
> On Thu, 2018-06-21 at 09:34 -0700, Manjunath Patil wrote:
>> The server may return NFS4ERR_NOSPC during NFSv4.1+ mount if there is
>> a
>> memory pressure to allocate a DRC slot for session being created. In
>> such cases, try with lower nfs versions, which may succeed as DRC is
>> shared by clients.
>>
>> Signed-off-by: Manjunath Patil <[email protected]>
>> ---
>> utils/mount/stropts.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
>> index d1b0708..7e97a88 100644
>> --- a/utils/mount/stropts.c
>> +++ b/utils/mount/stropts.c
>> @@ -881,6 +881,10 @@ check_result:
>> case EINVAL:
>> /* A less clear indication that our client
>> * does not support NFSv4 minor version. */
>> + case ENOSPC:
>> + /* Server returned NFS4ERR_NOSPC for create session
>> [NFSv4.1+].
>> + * Try with lower NFS versions which share DRC
>> amoung clients and
>> + * hence low memory may be ok. */
>> case EACCES:
>> /* An unclear indication that the server
>> * may not support NFSv4 minor version. */
>
> This comment makes no sense. NFSv4.1 servers also share memory between
> clients, and unlike older versions of NFS, they have ways to reclaim
> that memory (see CB_RECALL_SLOT).
>
So this is a NACK to this patch... just to make it official
steved.