Linux NFS development
 help / color / mirror / Atom feed
From: Chen Hanxiao <chenhx.fnst@fujitsu.com>
To: calum.mackay@oracle.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported
Date: Wed, 19 Mar 2025 11:23:43 +0800	[thread overview]
Message-ID: <20250319032402.1789-1-chenhx.fnst@fujitsu.com> (raw)

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 <chenhx.fnst@fujitsu.com>
---
 nfs4.1/server41tests/st_delegation.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nfs4.1/server41tests/st_delegation.py b/nfs4.1/server41tests/st_delegation.py
index fa9b451..f27e852 100644
--- a/nfs4.1/server41tests/st_delegation.py
+++ b/nfs4.1/server41tests/st_delegation.py
@@ -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
-- 
2.47.1


             reply	other threads:[~2025-03-19  3:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19  3:23 Chen Hanxiao [this message]
2025-03-20 11:00 ` [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported Jeff Layton
2025-03-25 20:21 ` Calum Mackay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319032402.1789-1-chenhx.fnst@fujitsu.com \
    --to=chenhx.fnst@fujitsu.com \
    --cc=calum.mackay@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox