diff options
author | Jeff Layton <jlayton@kernel.org> | 2022-10-18 07:47:54 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-11-28 12:54:44 -0500 |
commit | 8e823bafff2308753d430566256c83d8085952da (patch) | |
tree | af7565e53b37fd2ab010d7c7193e451663dc56f8 /fs/nfsd/nfsctl.c | |
parent | 841fd0a3cb490eae5dfd262eccb8c8b11d57f8b8 (diff) |
nfsd: ignore requests to disable unsupported versions
The kernel currently errors out if you attempt to enable or disable a
version that it doesn't recognize. Change it to ignore attempts to
disable an unrecognized version. If we don't support it, then there is
no harm in doing so.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index dc74a947a440..68ed42fd29fc 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -601,7 +601,9 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size) } break; default: - return -EINVAL; + /* Ignore requests to disable non-existent versions */ + if (cmd == NFSD_SET) + return -EINVAL; } vers += len + 1; } while ((len = qword_get(&mesg, vers, size)) > 0); |