* [PATCH 1/4] NFSv4: Don't clear capabilities that won't be reset
2025-08-29 16:57 ` [PATCH 0/4] More server capability fixes Trond Myklebust
@ 2025-08-29 16:57 ` Trond Myklebust
2025-08-29 16:57 ` [PATCH 2/4] NFSv4: Clear the NFS_CAP_FS_LOCATIONS flag if it is not set Trond Myklebust
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Trond Myklebust @ 2025-08-29 16:57 UTC (permalink / raw)
To: linux-nfs, Scott Haiden
From: Trond Myklebust <trond.myklebust@hammerspace.com>
Don't clear the capabilities that are not going to get reset by the call
to _nfs4_server_capabilities().
Reported-by: Scott Haiden <scott.b.haiden@gmail.com>
Fixes: b01f21cacde9 ("NFS: Fix the setting of capabilities when automounting a new filesystem")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
fs/nfs/nfs4proc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 7d2b67e06cc3..5b92fcf45dd7 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4092,7 +4092,6 @@ int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle)
};
int err;
- nfs_server_set_init_caps(server);
do {
err = nfs4_handle_exception(server,
_nfs4_server_capabilities(server, fhandle),
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/4] NFSv4: Clear the NFS_CAP_FS_LOCATIONS flag if it is not set
2025-08-29 16:57 ` [PATCH 0/4] More server capability fixes Trond Myklebust
2025-08-29 16:57 ` [PATCH 1/4] NFSv4: Don't clear capabilities that won't be reset Trond Myklebust
@ 2025-08-29 16:57 ` Trond Myklebust
2025-08-29 16:57 ` [PATCH 3/4] NFSv4: Clear NFS_CAP_OPEN_XOR and NFS_CAP_DELEGTIME if not supported Trond Myklebust
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Trond Myklebust @ 2025-08-29 16:57 UTC (permalink / raw)
To: linux-nfs, Scott Haiden
From: Trond Myklebust <trond.myklebust@hammerspace.com>
_nfs4_server_capabilities() is expected to clear any flags that are not
supported by the server.
Fixes: 8a59bb93b7e3 ("NFSv4 store server support for fs_location attribute")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
fs/nfs/nfs4proc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5b92fcf45dd7..d0f91d9430f6 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4013,8 +4013,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
res.attr_bitmask[2];
}
memcpy(server->attr_bitmask, res.attr_bitmask, sizeof(server->attr_bitmask));
- server->caps &= ~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS |
- NFS_CAP_SYMLINKS| NFS_CAP_SECURITY_LABEL);
+ server->caps &=
+ ~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS | NFS_CAP_SYMLINKS |
+ NFS_CAP_SECURITY_LABEL | NFS_CAP_FS_LOCATIONS);
server->fattr_valid = NFS_ATTR_FATTR_V4;
if (res.attr_bitmask[0] & FATTR4_WORD0_ACL &&
res.acl_bitmask & ACL4_SUPPORT_ALLOW_ACL)
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/4] NFSv4: Clear NFS_CAP_OPEN_XOR and NFS_CAP_DELEGTIME if not supported
2025-08-29 16:57 ` [PATCH 0/4] More server capability fixes Trond Myklebust
2025-08-29 16:57 ` [PATCH 1/4] NFSv4: Don't clear capabilities that won't be reset Trond Myklebust
2025-08-29 16:57 ` [PATCH 2/4] NFSv4: Clear the NFS_CAP_FS_LOCATIONS flag if it is not set Trond Myklebust
@ 2025-08-29 16:57 ` Trond Myklebust
2025-08-29 16:57 ` [PATCH 4/4] NFSv4: Clear the NFS_CAP_XATTR flag if not supported by the server Trond Myklebust
2025-08-29 19:21 ` [PATCH 0/4] More server capability fixes Scott Haiden
4 siblings, 0 replies; 9+ messages in thread
From: Trond Myklebust @ 2025-08-29 16:57 UTC (permalink / raw)
To: linux-nfs, Scott Haiden
From: Trond Myklebust <trond.myklebust@hammerspace.com>
_nfs4_server_capabilities() should clear capabilities that are not
supported by the server.
Fixes: d2a00cceb93a ("NFSv4: Detect support for OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
fs/nfs/nfs4proc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d0f91d9430f6..ce61253efd45 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4015,7 +4015,8 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
memcpy(server->attr_bitmask, res.attr_bitmask, sizeof(server->attr_bitmask));
server->caps &=
~(NFS_CAP_ACLS | NFS_CAP_HARDLINKS | NFS_CAP_SYMLINKS |
- NFS_CAP_SECURITY_LABEL | NFS_CAP_FS_LOCATIONS);
+ NFS_CAP_SECURITY_LABEL | NFS_CAP_FS_LOCATIONS |
+ NFS_CAP_OPEN_XOR | NFS_CAP_DELEGTIME);
server->fattr_valid = NFS_ATTR_FATTR_V4;
if (res.attr_bitmask[0] & FATTR4_WORD0_ACL &&
res.acl_bitmask & ACL4_SUPPORT_ALLOW_ACL)
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 4/4] NFSv4: Clear the NFS_CAP_XATTR flag if not supported by the server
2025-08-29 16:57 ` [PATCH 0/4] More server capability fixes Trond Myklebust
` (2 preceding siblings ...)
2025-08-29 16:57 ` [PATCH 3/4] NFSv4: Clear NFS_CAP_OPEN_XOR and NFS_CAP_DELEGTIME if not supported Trond Myklebust
@ 2025-08-29 16:57 ` Trond Myklebust
2025-08-29 19:21 ` [PATCH 0/4] More server capability fixes Scott Haiden
4 siblings, 0 replies; 9+ messages in thread
From: Trond Myklebust @ 2025-08-29 16:57 UTC (permalink / raw)
To: linux-nfs, Scott Haiden
From: Trond Myklebust <trond.myklebust@hammerspace.com>
nfs_server_set_fsinfo() shouldn't assume that NFS_CAP_XATTR is unset
on entry to the function.
Fixes: b78ef845c35d ("NFSv4.2: query the server for extended attribute support")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
fs/nfs/client.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 8fb4a950dd55..4e3dcc157a83 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -888,6 +888,8 @@ static void nfs_server_set_fsinfo(struct nfs_server *server,
if (fsinfo->xattr_support)
server->caps |= NFS_CAP_XATTR;
+ else
+ server->caps &= ~NFS_CAP_XATTR;
#endif
}
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 0/4] More server capability fixes
2025-08-29 16:57 ` [PATCH 0/4] More server capability fixes Trond Myklebust
` (3 preceding siblings ...)
2025-08-29 16:57 ` [PATCH 4/4] NFSv4: Clear the NFS_CAP_XATTR flag if not supported by the server Trond Myklebust
@ 2025-08-29 19:21 ` Scott Haiden
2025-09-09 3:35 ` Scott Haiden
4 siblings, 1 reply; 9+ messages in thread
From: Scott Haiden @ 2025-08-29 19:21 UTC (permalink / raw)
To: trondmy; +Cc: linux-nfs, scott.b.haiden
Hello,
I just tested 6.16.4 without these changes, which gives the same error,
and after applying them xattr works properly.
Thanks,
--Scott
^ permalink raw reply [flat|nested] 9+ messages in thread