[PATCH 2/5] pynfs: fix the check for delegated attribute support

Scott Mayhew
2026-04-03T13:27:48Z

The DELEG24 and DELEG25 tests should work regardless of whether the
server supports delegated attributes or not. fattr4_supported_attrs is
a bitmap4, so FATTR4_OPEN_ARGUMENTS needs to be shifted when checking to
see if that bit is set. Fix it, and remove the now unnecessary check
added by 3216fc3 ("pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not
supported").

Cc: Chen Hanxiao <chenhx.fnst@fujitsu.com>
Cc: Jeff Layton <jlayton@kernel.org>
Fixes: f684000 ("st_deleg: test delegated timestamps in CB_GETATTR")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
nfs4.1/server41tests/st_delegation.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py
index d41f12d..934e558 100644
--- a/nfs4.1/server41tests/st_delegation.py
+++ b/nfs4.1/server41tests/st_delegation.py
@@ -345,10 +345,7 @@ 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_SUPPORTED_ATTRS] & (1 << 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

--
2.53.0