summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2023-09-22 12:12:15 +0800
committerChristian Brauner <brauner@kernel.org>2023-09-22 14:08:02 +0200
commitdede367149c48822c9f699291d71a3211c2a91bb (patch)
treece6164dc36dbfe9bfc9c6b50c00178999d942d03 /fs
parente6ec453bd0f03a60a80f00f95ae2eaa260faa3c2 (diff)
downloadlinux-stable-dede367149c48822c9f699291d71a3211c2a91bb.tar.gz
linux-stable-dede367149c48822c9f699291d71a3211c2a91bb.tar.bz2
linux-stable-dede367149c48822c9f699291d71a3211c2a91bb.zip
autofs: fix protocol sub version setting
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/autofs/inode.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 0477bce7d277..6d2e01c9057d 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -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;
}