linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd: ensure that writing '+4' to /proc/fs/nfsd/versions enables minor version 0
@ 2018-08-08 11:36 Scott Mayhew
  2018-08-08 12:41 ` Trond Myklebust
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Mayhew @ 2018-08-08 11:36 UTC (permalink / raw)
  To: bfields, jlayton; +Cc: linux-nfs

According to commit d3635ff07e8 ("nfsd: fix configuration of supported
minor versions"), it should be possible to use either '4.0' or '4' to
enable or disable minor version 0.

Currently, writing '+4' to /proc/fs/nfsd/versions has no effect unless
no minor versions are enabled.  That leaves rpc.nfsd without an easy
way to re-enable v4.0, since that's what it does when invoked with
'-V 4.0'.

Fixes: d3635ff07e8 ("nfsd: fix configuration of supported minor versions")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 fs/nfsd/nfsctl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index d107b4426f7e..b3f9f9233953 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -614,6 +614,14 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
 					minor = 0;
 					while (nfsd_minorversion(minor, cmd) >= 0)
 						minor++;
+				} else if (cmd == NFSD_SET) {
+					/*
+					 * We have +4 but there are already some minors
+					 * enabled.  We must ensure 4.0 gets enabled,
+					 * since it could be a request from rpc.nfsd.
+					 */
+					if (nfsd_minorversion(0, cmd) < 0)
+						return -EINVAL;
 				}
 				break;
 			default:
-- 
2.14.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-09 20:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-08 11:36 [PATCH] nfsd: ensure that writing '+4' to /proc/fs/nfsd/versions enables minor version 0 Scott Mayhew
2018-08-08 12:41 ` Trond Myklebust
2018-08-08 13:07   ` Scott Mayhew
2018-08-09 15:46     ` Scott Mayhew
2018-08-09 18:11       ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).