]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.15/nfsd-ignore-requests-to-disable-unsupported-versions.patch
Fixes for 5.15
[thirdparty/kernel/stable-queue.git] / queue-5.15 / nfsd-ignore-requests-to-disable-unsupported-versions.patch
1 From b59fadb3b01eca42885ae89b2c24e54302b0566b Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 18 Oct 2022 07:47:54 -0400
4 Subject: nfsd: ignore requests to disable unsupported versions
5
6 From: Jeff Layton <jlayton@kernel.org>
7
8 [ Upstream commit 8e823bafff2308753d430566256c83d8085952da ]
9
10 The kernel currently errors out if you attempt to enable or disable a
11 version that it doesn't recognize. Change it to ignore attempts to
12 disable an unrecognized version. If we don't support it, then there is
13 no harm in doing so.
14
15 Signed-off-by: Jeff Layton <jlayton@kernel.org>
16 Reviewed-by: Tom Talpey <tom@talpey.com>
17 Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
18 ---
19 fs/nfsd/nfsctl.c | 4 +++-
20 1 file changed, 3 insertions(+), 1 deletion(-)
21
22 diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
23 index dc74a947a440c..68ed42fd29fc8 100644
24 --- a/fs/nfsd/nfsctl.c
25 +++ b/fs/nfsd/nfsctl.c
26 @@ -601,7 +601,9 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
27 }
28 break;
29 default:
30 - return -EINVAL;
31 + /* Ignore requests to disable non-existent versions */
32 + if (cmd == NFSD_SET)
33 + return -EINVAL;
34 }
35 vers += len + 1;
36 } while ((len = qword_get(&mesg, vers, size)) > 0);
37 --
38 2.43.0
39