]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4: Clear the NFS_CAP_FS_LOCATIONS flag if it is not set
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 29 Aug 2025 16:07:22 +0000 (09:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:32:02 +0000 (16:32 +0200)
[ Upstream commit dd5a8621b886b02f8341c5d4ea68eb2c552ebd3e ]

_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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4proc.c

index bc1eaabaf2c309780417e79fa7f1b961333ac93f..124b9cee6fed7d5f38e0ca44c878a09461cb53e4 100644 (file)
@@ -3882,8 +3882,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
                        res.attr_bitmask[2] &= FATTR4_WORD2_NFS42_MASK;
                }
                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)