Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported
@ 2025-03-19  3:23 Chen Hanxiao
  2025-03-20 11:00 ` Jeff Layton
  2025-03-25 20:21 ` Calum Mackay
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Hanxiao @ 2025-03-19  3:23 UTC (permalink / raw)
  To: calum.mackay; +Cc: linux-nfs

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported
  2025-03-19  3:23 [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported Chen Hanxiao
@ 2025-03-20 11:00 ` Jeff Layton
  2025-03-25 20:21 ` Calum Mackay
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2025-03-20 11:00 UTC (permalink / raw)
  To: Chen Hanxiao, calum.mackay; +Cc: linux-nfs

On Wed, 2025-03-19 at 11:23 +0800, Chen Hanxiao wrote:
> 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

Nice catch.

Reviewed-by: Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported
  2025-03-19  3:23 [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported Chen Hanxiao
  2025-03-20 11:00 ` Jeff Layton
@ 2025-03-25 20:21 ` Calum Mackay
  1 sibling, 0 replies; 3+ messages in thread
From: Calum Mackay @ 2025-03-25 20:21 UTC (permalink / raw)
  To: Chen Hanxiao; +Cc: Calum Mackay, linux-nfs

On 19/03/2025 3:23 am, Chen Hanxiao wrote:
> If FATTR4_OPEN_ARGUMENTS is not supportd, DELEG24 and DELEG25
> will throw:
> 	KeyError: 86
> 
> Check FATTR4_OPEN_ARGUMENTS in caps from server

That's great, thanks very much.

Applied; tagged pynfs-0.3

cheers,
calum.

> 
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-25 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19  3:23 [PATCH] pynfs: fix key error if FATTR4_OPEN_ARGUMENTS is not supported Chen Hanxiao
2025-03-20 11:00 ` Jeff Layton
2025-03-25 20:21 ` Calum Mackay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox