]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
autofs: fix protocol sub version setting
authorIan Kent <raven@themaw.net>
Fri, 22 Sep 2023 04:12:15 +0000 (12:12 +0800)
committerChristian Brauner <brauner@kernel.org>
Fri, 22 Sep 2023 12:08:02 +0000 (14:08 +0200)
There were a number of updates to protocol version 4, take account of
that when setting the super block info sub version field.

Signed-off-by: Ian Kent <raven@themaw.net>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
Message-Id: <20230922041215.13675-9-raven@themaw.net>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/autofs/inode.c

index 0477bce7d277bf7b5be4a09f0955d9bc97052a22..6d2e01c9057dab2031c58475f4d20648bc3678e2 100644 (file)
@@ -287,7 +287,17 @@ static int autofs_validate_protocol(struct fs_context *fc)
                sbi->version = AUTOFS_MAX_PROTO_VERSION;
        else
                sbi->version = sbi->max_proto;
-       sbi->sub_version = AUTOFS_PROTO_SUBVERSION;
+
+       switch (sbi->version) {
+       case 4:
+               sbi->sub_version = 7;
+               break;
+       case 5:
+               sbi->sub_version = AUTOFS_PROTO_SUBVERSION;
+               break;
+       default:
+               sbi->sub_version = 0;
+       }
 
        return 0;
 }