pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported
Subsystems (2)
PATCH 1/1 pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported
If FATTR4_OPEN_ARGUMENTS is not supportd, DELEG24 and DELEG25 will throw:
KeyError: 86
Check FATTR4_OPEN_ARGUMENTS in caps from server
Signed-off-by Chen Hanxiao <[email protected]>
--- nfs4.1/server41tests/st_delegation.py | 3 +++ 1 file changed, 3 insertions(+)
nfs4.1/server41tests/st_delegation.py +3 -0
@@ -311,6 +311,9 @@ def _testCbGetattr(t, env, change=0, size=0): OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG) + if FATTR4_OPEN_ARGUMENTS not in caps: + fail("FATTR4_OPEN_ARGUMENTS not supported") + if caps[FATTR4_SUPPORTED_ATTRS] & FATTR4_OPEN_ARGUMENTS: if caps[FATTR4_OPEN_ARGUMENTS].oa_share_access_want & OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS: openmask |= 1<<OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS
Signature · 1 line
2.47.1
Quoted 16 lines · Chen Hanxiao
If
FATTR4_OPEN_ARGUMENTSis not supportd, DELEG24 and DELEG25 will throw:
KeyError: 86Check
FATTR4_OPEN_ARGUMENTSin caps from serverSigned-off-by Chen Hanxiao <[email protected]>--- nfs4.1/server41tests/st_delegation.py | 3 +++ 1 file changed, 3 insertions(+)nfs4.1/server41tests/st_delegation.py +0
-0
nfs4.1/server41tests/st_delegation.py def _testCbGetattr(t, env, change=0, size=0): · line 319
Quoted 9 lines
nfs4.1/server41tests/st_delegation.py +3
-0@@ -311,6 +311,9 @@ def _testCbGetattr(t, env, change=0, size=0): OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG) + if FATTR4_OPEN_ARGUMENTS not in caps: + fail("FATTR4_OPEN_ARGUMENTS not supported") + if caps[FATTR4_SUPPORTED_ATTRS] & FATTR4_OPEN_ARGUMENTS: if caps[FATTR4_OPEN_ARGUMENTS].oa_share_access_want & OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS: openmask |= 1<<OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS
Nice catch.
Reviewed-by Jeff Layton <[email protected]>
Calum Mackay
AppliedQuoted 5 lines · Chen Hanxiao
If
FATTR4_OPEN_ARGUMENTSis not supportd, DELEG24 and DELEG25 will throw:
KeyError: 86Check
FATTR4_OPEN_ARGUMENTSin caps from server
That's great, thanks very much.
Applied; tagged pynfs-0.3
cheers,
calum.
Quoted 20 lines
Signed-off-by Chen Hanxiao <[email protected]>--- nfs4.1/server41tests/st_delegation.py | 3 +++ 1 file changed, 3 insertions(+)nfs4.1/server41tests/st_delegation.py +3
-0@@ -311,6 +311,9 @@ def _testCbGetattr(t, env, change=0, size=0): OPEN4_SHARE_ACCESS_WRITE | OPEN4_SHARE_ACCESS_WANT_WRITE_DELEG) + if FATTR4_OPEN_ARGUMENTS not in caps: + fail("FATTR4_OPEN_ARGUMENTS not supported") + if caps[FATTR4_SUPPORTED_ATTRS] & FATTR4_OPEN_ARGUMENTS: if caps[FATTR4_OPEN_ARGUMENTS].oa_share_access_want & OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS: openmask |= 1<<OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS