]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFSv4: Don't check for OPEN feature support in v4.1
authorScott Mayhew <smayhew@redhat.com>
Wed, 30 Apr 2025 11:12:29 +0000 (07:12 -0400)
committerAnna Schumaker <anna.schumaker@oracle.com>
Wed, 28 May 2025 21:17:13 +0000 (17:17 -0400)
fattr4_open_arguments is a v4.2 recommended attribute, so we shouldn't
be sending it to v4.1 servers.

Fixes: cb78f9b7d0c0 ("nfs: fix the fetch of FATTR4_OPEN_ARGUMENTS")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Cc: stable@vger.kernel.org # 6.11+
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/nfs4proc.c

index 8feb9abfe1522a271ee744afc430e387940495ab..d9c7035d5771013a78c88350750cccf132c43ba4 100644 (file)
@@ -3976,8 +3976,9 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
                     FATTR4_WORD0_CASE_INSENSITIVE |
                     FATTR4_WORD0_CASE_PRESERVING;
        if (minorversion)
-               bitmask[2] = FATTR4_WORD2_SUPPATTR_EXCLCREAT |
-                            FATTR4_WORD2_OPEN_ARGUMENTS;
+               bitmask[2] = FATTR4_WORD2_SUPPATTR_EXCLCREAT;
+       if (minorversion > 1)
+               bitmask[2] |= FATTR4_WORD2_OPEN_ARGUMENTS;
 
        status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, &res.seq_res, 0);
        if (status == 0) {