* [PATCH 1/4] utils/nfsd: fix -N optarg error printout
2009-04-13 8:25 [RFC 0/4] nfs-utils: nfsd support for minor version Benny Halevy
@ 2009-04-13 8:29 ` Benny Halevy
2009-04-13 8:29 ` [RFC 2/4] utils/nfsd: add support for minorvers4 Benny Halevy
` (4 subsequent siblings)
5 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-13 8:29 UTC (permalink / raw)
To: Steve Dickson; +Cc: J. Bruce Fields, linux-nfs, pnfs
as currently printed c is the version number, not a string char,
therefore is should be printed as %d not %c. That said, just print
optarg as %s since it might be non-numeric.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
utils/nfsd/nfsd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index aaf8d29..c97c81f 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -86,7 +86,7 @@ main(int argc, char **argv)
NFSCTL_VERUNSET(versbits, c);
break;
default:
- fprintf(stderr, "%c: Unsupported version\n", c);
+ fprintf(stderr, "%s: Unsupported version\n", optarg);
exit(1);
}
break;
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [RFC 2/4] utils/nfsd: add support for minorvers4
2009-04-13 8:25 [RFC 0/4] nfs-utils: nfsd support for minor version Benny Halevy
2009-04-13 8:29 ` [PATCH 1/4] utils/nfsd: fix -N optarg error printout Benny Halevy
@ 2009-04-13 8:29 ` Benny Halevy
2009-04-13 8:29 ` [RFC 3/4] utils/nfsd: add -n --nfs-version option Benny Halevy
` (3 subsequent siblings)
5 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-13 8:29 UTC (permalink / raw)
To: Steve Dickson; +Cc: J. Bruce Fields, linux-nfs, pnfs
minorvers4 can be used to either enable or disable nfsv4.x.
If minorvers4 is a positive integer n, in the allowed range (only
minorversion 1 is supported for now), the string "+4.n" is appended
to the versions string written onto /proc/fs/nfsd/versions.
Correspondingly, if minorver4 is a negative integer -n, the string
"-4.n" is written.
With the default value, minorvers4==0, the minor version
setting is not changed.
Note that unlike the protocol versions 2, 3, or 4. The minor version
setting controls the *maximum* minor version nfsd supports. Particular
minor version cannot be controlled on their own. With only minor version
1 supported at the moment the difference doesn't matter, but for future
minor versions greater than 1, enabling minor version X will enable support
for all minor versions 1 through X. Disabling minor version X will disable
support for minor versions X and up, enabling 1 through X-1.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
support/include/nfs/nfs.h | 3 +++
support/include/nfslib.h | 2 +-
support/nfs/nfssvc.c | 13 +++++++++----
utils/nfsd/nfsd.c | 3 ++-
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h
index fc26f4e..00b0028 100644
--- a/support/include/nfs/nfs.h
+++ b/support/include/nfs/nfs.h
@@ -13,6 +13,9 @@
#define NFSD_MINVERS 2
#define NFSD_MAXVERS 4
+#define NFSD_MINMINORVERS4 1
+#define NFSD_MAXMINORVERS4 1
+
struct nfs_fh_len {
int fh_size;
u_int8_t fh_handle[NFS3_FHSIZE];
diff --git a/support/include/nfslib.h b/support/include/nfslib.h
index 9d0d39d..ae98650 100644
--- a/support/include/nfslib.h
+++ b/support/include/nfslib.h
@@ -130,7 +130,7 @@ int wildmat(char *text, char *pattern);
* nfsd library functions.
*/
int nfsctl(int, struct nfsctl_arg *, union nfsctl_res *);
-int nfssvc(int port, int nrservs, unsigned int versbits, unsigned int portbits, char *haddr);
+int nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4, unsigned int portbits, char *haddr);
int nfsaddclient(struct nfsctl_client *clp);
int nfsdelclient(struct nfsctl_client *clp);
int nfsexport(struct nfsctl_export *exp);
diff --git a/support/nfs/nfssvc.c b/support/nfs/nfssvc.c
index 9bbc9a5..33c15a7 100644
--- a/support/nfs/nfssvc.c
+++ b/support/nfs/nfssvc.c
@@ -116,7 +116,7 @@ nfssvc_setfds(int port, unsigned int ctlbits, char *haddr)
return;
}
static void
-nfssvc_versbits(unsigned int ctlbits)
+nfssvc_versbits(unsigned int ctlbits, int minorvers4)
{
int fd, n, off;
char buf[BUFSIZ], *ptr;
@@ -133,6 +133,11 @@ nfssvc_versbits(unsigned int ctlbits)
else
off += snprintf(ptr+off, BUFSIZ - off, "-%d ", n);
}
+ n = minorvers4 >= 0 ? minorvers4 : -minorvers4;
+ if (n >= NFSD_MINMINORVERS4 && n <= NFSD_MAXMINORVERS4)
+ off += snprintf(ptr+off, BUFSIZ - off, "%c4.%d",
+ minorvers4 > 0 ? '+' : '-',
+ n);
snprintf(ptr+off, BUFSIZ - off, "\n");
if (write(fd, buf, strlen(buf)) != strlen(buf)) {
syslog(LOG_ERR, "nfssvc: Setting version failed: errno %d (%s)",
@@ -143,8 +148,8 @@ nfssvc_versbits(unsigned int ctlbits)
return;
}
int
-nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
- char *haddr)
+nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4,
+ unsigned protobits, char *haddr)
{
struct nfsctl_arg arg;
int fd;
@@ -153,7 +158,7 @@ nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
* the ports get registered with portmap against correct
* versions
*/
- nfssvc_versbits(versbits);
+ nfssvc_versbits(versbits, minorvers4);
nfssvc_setfds(port, protobits, haddr);
fd = open(NFSD_THREAD_FILE, O_WRONLY);
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index c97c81f..ac264da 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -41,6 +41,7 @@ static struct option longopts[] =
};
unsigned int protobits = NFSCTL_ALLBITS;
unsigned int versbits = NFSCTL_ALLBITS;
+int minorvers4; /* nfsv4 minor version */
char *haddr = NULL;
int
@@ -158,7 +159,7 @@ main(int argc, char **argv)
closeall(3);
openlog("nfsd", LOG_PID, LOG_DAEMON);
- if ((error = nfssvc(port, count, versbits, protobits, haddr)) < 0) {
+ if ((error = nfssvc(port, count, versbits, minorvers4, protobits, haddr)) < 0) {
int e = errno;
syslog(LOG_ERR, "nfssvc: %s", strerror(e));
closelog();
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [RFC 3/4] utils/nfsd: add -n --nfs-version option
2009-04-13 8:25 [RFC 0/4] nfs-utils: nfsd support for minor version Benny Halevy
2009-04-13 8:29 ` [PATCH 1/4] utils/nfsd: fix -N optarg error printout Benny Halevy
2009-04-13 8:29 ` [RFC 2/4] utils/nfsd: add support for minorvers4 Benny Halevy
@ 2009-04-13 8:29 ` Benny Halevy
2009-04-13 8:29 ` [RFC 4/4] utils/nfsd: enable/disable minorvers4 via command line Benny Halevy
` (2 subsequent siblings)
5 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-13 8:29 UTC (permalink / raw)
To: Steve Dickson; +Cc: J. Bruce Fields, linux-nfs, pnfs
Add the -n --nfs-version option to enable versions, in contrast
to -N --no-nfs-version. This will be useful for enabling nfsv4
minor versions.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
support/include/nfs/nfs.h | 2 ++
utils/nfsd/nfsd.c | 17 +++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h
index 00b0028..2220305 100644
--- a/support/include/nfs/nfs.h
+++ b/support/include/nfs/nfs.h
@@ -42,6 +42,8 @@ struct nfs_fh_old {
#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
#define NFSCTL_GETFS 8 /* get an fh by path with max size (used by mountd) */
+#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << ((_v) - 1)))
+
#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << ((_v) - 1)))
#define NFSCTL_UDPUNSET(_cltbits) ((_cltbits) &= ~(1 << (17 - 1)))
#define NFSCTL_TCPUNSET(_cltbits) ((_cltbits) &= ~(1 << (18 - 1)))
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index ac264da..3d88b72 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -32,6 +32,7 @@ static struct option longopts[] =
{
{ "host", 1, 0, 'H' },
{ "help", 0, 0, 'h' },
+ { "nfs-version", 1, 0, 'n' },
{ "no-nfs-version", 1, 0, 'N' },
{ "no-tcp", 0, 0, 'T' },
{ "no-udp", 0, 0, 'U' },
@@ -57,7 +58,7 @@ main(int argc, char **argv)
else
port = 2049;
- while ((c = getopt_long(argc, argv, "H:hN:p:P:TU", longopts, NULL)) != EOF) {
+ while ((c = getopt_long(argc, argv, "H:hn:N:p:P:TU", longopts, NULL)) != EOF) {
switch(c) {
case 'H':
if (inet_addr(optarg) != INADDR_NONE) {
@@ -79,6 +80,18 @@ main(int argc, char **argv)
usage(argv [0]);
}
break;
+ case 'n':
+ switch((c = atoi(optarg))) {
+ case 4:
+ case 3:
+ case 2:
+ NFSCTL_VERSET(versbits, c);
+ break;
+ default:
+ fprintf(stderr, "%s: Unsupported version\n", optarg);
+ exit(1);
+ }
+ break;
case 'N':
switch((c = atoi(optarg))) {
case 2:
@@ -172,7 +185,7 @@ static void
usage(const char *prog)
{
fprintf(stderr, "Usage:\n"
- "%s [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-T|--no-tcp] [-U|--no-udp] nrservs\n",
+ "%s [-H hostname] [-p|-P|--port port] [-n|--nfs-version version] [-N|--no-nfs-version version] [-T|--no-tcp] [-U|--no-udp] nrservs\n",
prog);
exit(2);
}
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [RFC 4/4] utils/nfsd: enable/disable minorvers4 via command line
2009-04-13 8:25 [RFC 0/4] nfs-utils: nfsd support for minor version Benny Halevy
` (2 preceding siblings ...)
2009-04-13 8:29 ` [RFC 3/4] utils/nfsd: add -n --nfs-version option Benny Halevy
@ 2009-04-13 8:29 ` Benny Halevy
2009-04-16 17:24 ` [RFC 0/4] nfs-utils: nfsd support for minor version Steve Dickson
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
5 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-13 8:29 UTC (permalink / raw)
To: Steve Dickson; +Cc: J. Bruce Fields, linux-nfs, pnfs
Extend -n/-N command line option syntax to accept <version>.<minorversion>
Only 4.1 is currently supported.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
utils/nfsd/nfsd.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index 3d88b72..ce88989 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -51,6 +51,7 @@ main(int argc, char **argv)
int count = 1, c, error, port, fd, found_one;
struct servent *ent;
struct hostent *hp;
+ char *p;
ent = getservbyname ("nfs", "udp");
if (ent != NULL)
@@ -81,8 +82,12 @@ main(int argc, char **argv)
}
break;
case 'n':
- switch((c = atoi(optarg))) {
+ switch((c = strtol(optarg, &p, 0))) {
case 4:
+ if (*p == '.') {
+ minorvers4 = atoi(p + 1);
+ break;
+ }
case 3:
case 2:
NFSCTL_VERSET(versbits, c);
@@ -93,10 +98,14 @@ main(int argc, char **argv)
}
break;
case 'N':
- switch((c = atoi(optarg))) {
- case 2:
- case 3:
+ switch((c = strtol(optarg, &p, 0))) {
case 4:
+ if (*p == '.') {
+ minorvers4 = -atoi(p + 1);
+ break;
+ }
+ case 3:
+ case 2:
NFSCTL_VERUNSET(versbits, c);
break;
default:
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* Re: [RFC 0/4] nfs-utils: nfsd support for minor version
2009-04-13 8:25 [RFC 0/4] nfs-utils: nfsd support for minor version Benny Halevy
` (3 preceding siblings ...)
2009-04-13 8:29 ` [RFC 4/4] utils/nfsd: enable/disable minorvers4 via command line Benny Halevy
@ 2009-04-16 17:24 ` Steve Dickson
[not found] ` <49E769C5.6010902-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
5 siblings, 1 reply; 23+ messages in thread
From: Steve Dickson @ 2009-04-16 17:24 UTC (permalink / raw)
To: Benny Halevy; +Cc: NFS list, pNFS Mailing List, J. Bruce Fields
Hey Benny,
Benny Halevy wrote:
> Steve, please review the following patch that add support
> for controlling the nfsv4 minor version support via
> /proc/fs/nfsd/versions.
>
> [PATCH 1/4] utils/nfsd: fix -N optarg error printout
> This patch fixes an existing bug.
This is a bug... and has been committed...
>
> [RFC 2/4] utils/nfsd: add support for minorvers4
> Under-the-cover support for minorvers4
I see you let minorvers4 default to zero, which means 4.1
support is off by default. Why? As long as we have away to
turn of 4.1 processing (i.e. your 4/4 patch), then I see
no reason we should have the support enabled by default.
>
> [RFC 3/4] utils/nfsd: add -n --nfs-version option
> Add a command line option to enable versions
I'm assuming you added this to be able to turn on 4.1 processing.
But 4.1 is on by default, the '-n' flag not need, correct?
>
> [RFC 4/4] utils/nfsd: enable/disable minorvers4 via command line
> Extend -n/-N syntax to accept <version>.<minorversion>
look reasonable...
steved.
^ permalink raw reply [flat|nested] 23+ messages in thread* [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2
2009-04-13 8:25 [RFC 0/4] nfs-utils: nfsd support for minor version Benny Halevy
` (4 preceding siblings ...)
2009-04-16 17:24 ` [RFC 0/4] nfs-utils: nfsd support for minor version Steve Dickson
@ 2009-04-22 12:06 ` Benny Halevy
2009-04-22 12:10 ` [PATCH 1/3] utils/nfsd: add support for minorvers4 Benny Halevy
` (4 more replies)
5 siblings, 5 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-22 12:06 UTC (permalink / raw)
To: Steve Dickson; +Cc: NFS list, pNFS Mailing List, J. Bruce Fields, Chuck Lever
Following the discussion we had last week
(see http://linux-nfs.org/pipermail/pnfs/2009-April/007283.html)
I made the following changes:
* minorvers4 enabled by default.
* No new -n option.
This makes minorvers control essentially the same as
the major protocol version. minorvers4 is enabled by default
and can be disabled using -N 4.1.
On Fedora, /etc/sysconfig/nfs can be changed as follows
to configure the service startup script to disable 4.1:
--- /etc/sysconfig/nfs.orig 2009-04-22 14:57:15.000000000 +0300
+++ /etc/sysconfig/nfs 2009-04-22 14:46:52.000000000 +0300
@@ -26,6 +26,8 @@
#RPCNFSDARGS="-N 2 -N 3"
# Turn off v4 protocol support
#RPCNFSDARGS="-N 4"
+# Turn off v4.1 minorversion support
+RPCNFSDARGS="-N 4.1"
# Number of nfs server processes to be started.
# The default is 8.
#RPCNFSDCOUNT=8
The patches in this set are:
[PATCH 1/3] utils/nfsd: add support for minorvers4
[PATCH 2/3] utils/nfsd: disable minorvers4 via command line
[PATCH 3/3] utils/nfsd: enable nfs minorvers4 by default
Benny
^ permalink raw reply [flat|nested] 23+ messages in thread* [PATCH 1/3] utils/nfsd: add support for minorvers4
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
@ 2009-04-22 12:10 ` Benny Halevy
2009-04-22 12:10 ` [PATCH 2/3] utils/nfsd: disable minorvers4 via command line Benny Halevy
` (3 subsequent siblings)
4 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-22 12:10 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs, pnfs, J. Bruce Fields, Chuck Lever
minorvers4 can be used to either enable or disable nfsv4.x.
If minorvers4 is a positive integer n, in the allowed range (only
minorversion 1 is supported for now), the string "+4.n" is appended
to the versions string written onto /proc/fs/nfsd/versions.
Correspondingly, if minorver4 is a negative integer -n, the string
"-4.n" is written.
With the default value, minorvers4==0, the minor version
setting is not changed.
Note that unlike the protocol versions 2, 3, or 4. The minor version
setting controls the *maximum* minor version nfsd supports. Particular
minor version cannot be controlled on their own. With only minor version
1 supported at the moment the difference doesn't matter, but for future
minor versions greater than 1, enabling minor version X will enable support
for all minor versions 1 through X. Disabling minor version X will disable
support for minor versions X and up, enabling 1 through X-1.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
support/include/nfs/nfs.h | 3 +++
support/include/nfslib.h | 2 +-
support/nfs/nfssvc.c | 13 +++++++++----
utils/nfsd/nfsd.c | 3 ++-
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h
index fc26f4e..00b0028 100644
--- a/support/include/nfs/nfs.h
+++ b/support/include/nfs/nfs.h
@@ -13,6 +13,9 @@
#define NFSD_MINVERS 2
#define NFSD_MAXVERS 4
+#define NFSD_MINMINORVERS4 1
+#define NFSD_MAXMINORVERS4 1
+
struct nfs_fh_len {
int fh_size;
u_int8_t fh_handle[NFS3_FHSIZE];
diff --git a/support/include/nfslib.h b/support/include/nfslib.h
index 9d0d39d..ae98650 100644
--- a/support/include/nfslib.h
+++ b/support/include/nfslib.h
@@ -130,7 +130,7 @@ int wildmat(char *text, char *pattern);
* nfsd library functions.
*/
int nfsctl(int, struct nfsctl_arg *, union nfsctl_res *);
-int nfssvc(int port, int nrservs, unsigned int versbits, unsigned int portbits, char *haddr);
+int nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4, unsigned int portbits, char *haddr);
int nfsaddclient(struct nfsctl_client *clp);
int nfsdelclient(struct nfsctl_client *clp);
int nfsexport(struct nfsctl_export *exp);
diff --git a/support/nfs/nfssvc.c b/support/nfs/nfssvc.c
index 9bbc9a5..33c15a7 100644
--- a/support/nfs/nfssvc.c
+++ b/support/nfs/nfssvc.c
@@ -116,7 +116,7 @@ nfssvc_setfds(int port, unsigned int ctlbits, char *haddr)
return;
}
static void
-nfssvc_versbits(unsigned int ctlbits)
+nfssvc_versbits(unsigned int ctlbits, int minorvers4)
{
int fd, n, off;
char buf[BUFSIZ], *ptr;
@@ -133,6 +133,11 @@ nfssvc_versbits(unsigned int ctlbits)
else
off += snprintf(ptr+off, BUFSIZ - off, "-%d ", n);
}
+ n = minorvers4 >= 0 ? minorvers4 : -minorvers4;
+ if (n >= NFSD_MINMINORVERS4 && n <= NFSD_MAXMINORVERS4)
+ off += snprintf(ptr+off, BUFSIZ - off, "%c4.%d",
+ minorvers4 > 0 ? '+' : '-',
+ n);
snprintf(ptr+off, BUFSIZ - off, "\n");
if (write(fd, buf, strlen(buf)) != strlen(buf)) {
syslog(LOG_ERR, "nfssvc: Setting version failed: errno %d (%s)",
@@ -143,8 +148,8 @@ nfssvc_versbits(unsigned int ctlbits)
return;
}
int
-nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
- char *haddr)
+nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4,
+ unsigned protobits, char *haddr)
{
struct nfsctl_arg arg;
int fd;
@@ -153,7 +158,7 @@ nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
* the ports get registered with portmap against correct
* versions
*/
- nfssvc_versbits(versbits);
+ nfssvc_versbits(versbits, minorvers4);
nfssvc_setfds(port, protobits, haddr);
fd = open(NFSD_THREAD_FILE, O_WRONLY);
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index c97c81f..ac264da 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -41,6 +41,7 @@ static struct option longopts[] =
};
unsigned int protobits = NFSCTL_ALLBITS;
unsigned int versbits = NFSCTL_ALLBITS;
+int minorvers4; /* nfsv4 minor version */
char *haddr = NULL;
int
@@ -158,7 +159,7 @@ main(int argc, char **argv)
closeall(3);
openlog("nfsd", LOG_PID, LOG_DAEMON);
- if ((error = nfssvc(port, count, versbits, protobits, haddr)) < 0) {
+ if ((error = nfssvc(port, count, versbits, minorvers4, protobits, haddr)) < 0) {
int e = errno;
syslog(LOG_ERR, "nfssvc: %s", strerror(e));
closelog();
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 2/3] utils/nfsd: disable minorvers4 via command line
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
2009-04-22 12:10 ` [PATCH 1/3] utils/nfsd: add support for minorvers4 Benny Halevy
@ 2009-04-22 12:10 ` Benny Halevy
2009-04-22 12:10 ` [PATCH 3/3] utils/nfsd: enable nfs minorvers4 by default Benny Halevy
` (2 subsequent siblings)
4 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-22 12:10 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs, pnfs, J. Bruce Fields, Chuck Lever
Extend -N command line option syntax to accept <version>.<minorversion>
to disable support for <minorversion>.
Only 4.1 is currently supported.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
utils/nfsd/nfsd.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index ac264da..bd23d9d 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -50,6 +50,7 @@ main(int argc, char **argv)
int count = 1, c, error, port, fd, found_one;
struct servent *ent;
struct hostent *hp;
+ char *p;
ent = getservbyname ("nfs", "udp");
if (ent != NULL)
@@ -80,10 +81,14 @@ main(int argc, char **argv)
}
break;
case 'N':
- switch((c = atoi(optarg))) {
- case 2:
- case 3:
+ switch((c = strtol(optarg, &p, 0))) {
case 4:
+ if (*p == '.') {
+ minorvers4 = -atoi(p + 1);
+ break;
+ }
+ case 3:
+ case 2:
NFSCTL_VERUNSET(versbits, c);
break;
default:
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread* [PATCH 3/3] utils/nfsd: enable nfs minorvers4 by default
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
2009-04-22 12:10 ` [PATCH 1/3] utils/nfsd: add support for minorvers4 Benny Halevy
2009-04-22 12:10 ` [PATCH 2/3] utils/nfsd: disable minorvers4 via command line Benny Halevy
@ 2009-04-22 12:10 ` Benny Halevy
2009-04-22 21:54 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 J. Bruce Fields
2009-05-18 14:49 ` Steve Dickson
4 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-22 12:10 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs, pnfs, J. Bruce Fields, Chuck Lever
Enable support for the maximum minor version (4.1 at the moment)
by default. It can be disabled using the -N command line
option.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
utils/nfsd/nfsd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index bd23d9d..e3c0094 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -41,7 +41,7 @@ static struct option longopts[] =
};
unsigned int protobits = NFSCTL_ALLBITS;
unsigned int versbits = NFSCTL_ALLBITS;
-int minorvers4; /* nfsv4 minor version */
+int minorvers4 = NFSD_MAXMINORVERS4; /* nfsv4 minor version */
char *haddr = NULL;
int
--
1.6.2.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
` (2 preceding siblings ...)
2009-04-22 12:10 ` [PATCH 3/3] utils/nfsd: enable nfs minorvers4 by default Benny Halevy
@ 2009-04-22 21:54 ` J. Bruce Fields
2009-04-23 8:58 ` Benny Halevy
2009-05-18 14:49 ` Steve Dickson
4 siblings, 1 reply; 23+ messages in thread
From: J. Bruce Fields @ 2009-04-22 21:54 UTC (permalink / raw)
To: Benny Halevy; +Cc: Steve Dickson, NFS list, pNFS Mailing List, Chuck Lever
On Wed, Apr 22, 2009 at 03:06:30PM +0300, Benny Halevy wrote:
> Following the discussion we had last week
> (see http://linux-nfs.org/pipermail/pnfs/2009-April/007283.html)
>
> I made the following changes:
> * minorvers4 enabled by default.
> * No new -n option.
>
> This makes minorvers control essentially the same as
> the major protocol version. minorvers4 is enabled by default
> and can be disabled using -N 4.1.
>
> On Fedora, /etc/sysconfig/nfs can be changed as follows
> to configure the service startup script to disable 4.1:
Why couldn't nfs-utils just respect the kernel's default and make no
attempt to set the minor version? A (possibly undocumented) -P 4.1
option (or some other name) could be used by testers to specify that
they want 4.1. After things have settled down a little we'd change the
kernel's default, and then only -N 4.1 would be needed.
If I'd known we'd be enabling 4.1 by default in nfs-utils, I wouldn't
have been so happy about removing the 4.1 config option--how confident
are we that the 4.1 code to be in 2.6.30 has no security holes?
--b.
>
> --- /etc/sysconfig/nfs.orig 2009-04-22 14:57:15.000000000 +0300
> +++ /etc/sysconfig/nfs 2009-04-22 14:46:52.000000000 +0300
> @@ -26,6 +26,8 @@
> #RPCNFSDARGS="-N 2 -N 3"
> # Turn off v4 protocol support
> #RPCNFSDARGS="-N 4"
> +# Turn off v4.1 minorversion support
> +RPCNFSDARGS="-N 4.1"
> # Number of nfs server processes to be started.
> # The default is 8.
> #RPCNFSDCOUNT=8
>
> The patches in this set are:
> [PATCH 1/3] utils/nfsd: add support for minorvers4
> [PATCH 2/3] utils/nfsd: disable minorvers4 via command line
> [PATCH 3/3] utils/nfsd: enable nfs minorvers4 by default
>
> Benny
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2
2009-04-22 21:54 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 J. Bruce Fields
@ 2009-04-23 8:58 ` Benny Halevy
0 siblings, 0 replies; 23+ messages in thread
From: Benny Halevy @ 2009-04-23 8:58 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Steve Dickson, NFS list, pNFS Mailing List, Chuck Lever
On Apr. 23, 2009, 0:54 +0300, "J. Bruce Fields" <bfields@fieldses.org> wrote:
> On Wed, Apr 22, 2009 at 03:06:30PM +0300, Benny Halevy wrote:
>> Following the discussion we had last week
>> (see http://linux-nfs.org/pipermail/pnfs/2009-April/007283.html)
>>
>> I made the following changes:
>> * minorvers4 enabled by default.
>> * No new -n option.
>>
>> This makes minorvers control essentially the same as
>> the major protocol version. minorvers4 is enabled by default
>> and can be disabled using -N 4.1.
>>
>> On Fedora, /etc/sysconfig/nfs can be changed as follows
>> to configure the service startup script to disable 4.1:
>
> Why couldn't nfs-utils just respect the kernel's default and make no
> attempt to set the minor version? A (possibly undocumented) -P 4.1
> option (or some other name) could be used by testers to specify that
> they want 4.1. After things have settled down a little we'd change the
> kernel's default, and then only -N 4.1 would be needed.
It could, and that was pretty much my original intent, which was
criticized by Steve and others for being overly cautious. I agree with
Chuck that the distributions using nfs-utils should decide about the
default and that can be done either way. The difference is for people
upgrading nfs-utils while keeping their old /etc/sysconfig/nfs.
I've no problem with having an option to enable 4.1 (and I don't care
much if it's -n or -P either). Should a distribution that want this option
enabled by default use an undocumented option? I'm not sure.
I'd prefer it to be documented if that's the case.
>
> If I'd known we'd be enabling 4.1 by default in nfs-utils, I wouldn't
> have been so happy about removing the 4.1 config option--how confident
> are we that the 4.1 code to be in 2.6.30 has no security holes?
The more it will be tested and used, the better my confidence will be.
I don't think that disabling it by default will help us find any security
holes before the code will be ready for prime time. Not without a
full blown QA effort.
Benny
>
> --b.
>
>> --- /etc/sysconfig/nfs.orig 2009-04-22 14:57:15.000000000 +0300
>> +++ /etc/sysconfig/nfs 2009-04-22 14:46:52.000000000 +0300
>> @@ -26,6 +26,8 @@
>> #RPCNFSDARGS="-N 2 -N 3"
>> # Turn off v4 protocol support
>> #RPCNFSDARGS="-N 4"
>> +# Turn off v4.1 minorversion support
>> +RPCNFSDARGS="-N 4.1"
>> # Number of nfs server processes to be started.
>> # The default is 8.
>> #RPCNFSDCOUNT=8
>>
>> The patches in this set are:
>> [PATCH 1/3] utils/nfsd: add support for minorvers4
>> [PATCH 2/3] utils/nfsd: disable minorvers4 via command line
>> [PATCH 3/3] utils/nfsd: enable nfs minorvers4 by default
>>
>> Benny
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2
2009-04-22 12:06 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 Benny Halevy
` (3 preceding siblings ...)
2009-04-22 21:54 ` [PATCH 0/3] nfs-utils: nfsd support for minor version, take 2 J. Bruce Fields
@ 2009-05-18 14:49 ` Steve Dickson
4 siblings, 0 replies; 23+ messages in thread
From: Steve Dickson @ 2009-05-18 14:49 UTC (permalink / raw)
To: Benny Halevy; +Cc: NFS list, pNFS Mailing List, J. Bruce Fields, Chuck Lever
Sorry it took so long...
Benny Halevy wrote:
> Following the discussion we had last week
> (see http://linux-nfs.org/pipermail/pnfs/2009-April/007283.html)
>
> I made the following changes:
> * minorvers4 enabled by default.
> * No new -n option.
>
> This makes minorvers control essentially the same as
> the major protocol version. minorvers4 is enabled by default
> and can be disabled using -N 4.1.
>
> On Fedora, /etc/sysconfig/nfs can be changed as follows
> to configure the service startup script to disable 4.1:
Committed...
steved.
^ permalink raw reply [flat|nested] 23+ messages in thread