Skip to contentSkip to conversation

st_getattr: do not expect server to return rdattr_error

PATCH Applied Tigran Mkrtchyan 2 participants 2 messages Feb 8, 2019 – Feb 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 st_getattr: do not expect server to return rdattr_error

rfc7530:
5.8.1.12. Attribute 11: rdattr_error

Error returned from an attempt to retrieve attributes during a READDIR operation.

IOW, we do not expect rdattr_error to be returned in reply to regular GETATTR operation.

---
 nfs4.0/servertests/st_getattr.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
nfs4.0/servertests/st_getattr.py +3 -1
index 292fcd2..1c47ebf 100644
@@ -1,12 +1,14 @@
 from xdrdef.nfs4_const import *
 from .environment import check
-from nfs4lib import get_attr_name
+from nfs4lib import get_attr_name, get_attrbitnum_dict
 import nfs_ops
 op = nfs_ops.NFS4ops()
 
 def _try_mandatory(t, env, path):
     c = env.c1
     mandatory = [attr.bitnum for attr in env.attr_info if attr.mandatory]
+    # don't expect rdattr_error to be a part of returned attributes
+    mandatory.remove(get_attrbitnum_dict()['rdattr_error'])
     ops = c.use_obj(path)
     ops += [c.getattr(mandatory)]
     res = c.compound(ops)
Signature · 1 line
2.20.1
#1 lore raw
Quoted 8 lines · Tigran Mkrtchyan

rfc7530:
5.8.1.12. Attribute 11: rdattr_error

Error returned from an attempt to retrieve attributes during a READDIR operation.

IOW, we do not expect rdattr_error to be returned in reply to regular GETATTR operation.

Applied, thanks!

--b.

Quoted 28 lines
---
 nfs4.0/servertests/st_getattr.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
nfs4.0/servertests/st_getattr.py +3 -1
index 292fcd2..1c47ebf 100644
@@ -1,12 +1,14 @@
 from xdrdef.nfs4_const import *
 from .environment import check
-from nfs4lib import get_attr_name
+from nfs4lib import get_attr_name, get_attrbitnum_dict
 import nfs_ops
 op = nfs_ops.NFS4ops()
 
 def _try_mandatory(t, env, path):
     c = env.c1
     mandatory = [attr.bitnum for attr in env.attr_info if attr.mandatory]
+    # don't expect rdattr_error to be a part of returned attributes
+    mandatory.remove(get_attrbitnum_dict()['rdattr_error'])
     ops = c.use_obj(path)
     ops += [c.getattr(mandatory)]
     res = c.compound(ops)
Signature · 1 line
2.20.1