configure.ac: Added server 4.1 support configuration option
Subsystems (2)
PATCH 1/2 configure.ac: Added server 4.1 support configuration option
Separate the v4.1 support in the client and server by creating the --enable-nfsdv4 configuration option.
--- configure.ac | 19 ++++++++++++++++--- support/include/nfs/nfs.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-)
configure.ac +16 -3
@@ -75,17 +75,30 @@ AC_ARG_ENABLE(nfsv4, AC_ARG_ENABLE(nfsv41, [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], + [enable for NFS v4.1 client support @<:@default=yes@:>@])], enable_nfsv41=$enableval, - enable_nfsv41=no) + enable_nfsv41=yes) if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) + AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv4.1 client support compiled in]) else enable_nfsv41= fi AC_SUBST(enable_nfsv41) AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) +AC_ARG_ENABLE(nfsvd41, + [AC_HELP_STRING([--enable-nfsdv41], + [enable for NFS v4.1 server support @<:@default=no@:>@])], + enable_nfsdv41=$enableval, + enable_nfsvd41=no) + if test "$enable_nfsdv41" = yes; then + AC_DEFINE(NFSD41_SUPPORTED, 1, [Define this if you want NFSv4.1 server support compiled in]) + else + enable_nfsdv41= + fi + AC_SUBST(enable_nfsdv41) + AM_CONDITIONAL(CONFIG_NFSDV41, [test "$enable_nfsdv41" = "yes"]) + AC_ARG_ENABLE(gss, [AC_HELP_STRING([--enable-gss], [enable support for rpcsec_gss @<:@default=yes@:>@])],
support/include/nfs/nfs.h +1 -1
@@ -16,7 +16,7 @@#define NFSD_MAXVERS 4#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED +#ifdef NFSD41_SUPPORTED #define NFSD_MAXMINORVERS4 1#else #define NFSD_MAXMINORVERS4 0
Signature · 1 line
1.7.6
PATCH 2/2 configure.ac: Remove unused NFS3_SUPPORTED define
This configuration option is not used. So remove
it for now then possibly added it back when
V3 supported is disabled.
--- configure.ac | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-)
configure.ac +1 -11
@@ -46,17 +46,7 @@ AC_ARG_WITH(start-statd, ) AC_SUBST(startstatd) AC_DEFINE_UNQUOTED(START_STATD, "$startstatd", [Define this to a script which can start statd on mount]) -AC_ARG_ENABLE(nfsv3, - [AC_HELP_STRING([--enable-nfsv3], - [enable support for NFSv3 @<:@default=yes@:>@])], - enable_nfsv3=$enableval, - enable_nfsv3=yes) - if test "$enable_nfsv3" = yes; then - AC_DEFINE(NFS3_SUPPORTED, 1, [Define this if you want NFSv3 support compiled in]) - else - enable_nfsv3= - fi - AC_SUBST(enable_nfsv3) + AC_ARG_ENABLE(nfsv4, [AC_HELP_STRING([--enable-nfsv4], [enable support for NFSv4 @<:@default=yes@:>@])],
Signature · 1 line
1.7.6
Quoted 2 lines · Steve Dickson
Separate the v4.1 support in the client and server by creating the --enable-nfsdv4 configuration option.
I really dislike --enable-nfsdv4: people shouldn't have to rebuild nfs-utils in order to turn on server 4.1 support. They should be able to do that at run time.
It makes sense for something like the block client, because there we actually have to decide whether to *build* something or not, and if someone knows they're never going to use that daemon, maybe they don't want to bother building and installing it.
For server 4.1 support, we're making them rebuild just to change the value of a single constant. Why?
--b.
Quoted 65 lines
Signed-off-by Steve Dickson <[email protected]>--- configure.ac | 19 ++++++++++++++++--- support/include/nfs/nfs.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-)configure.ac +16
-3@@ -75,17 +75,30 @@ AC_ARG_ENABLE(nfsv4, AC_ARG_ENABLE(nfsv41, [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], + [enable for NFS v4.1 client support @<:@default=yes@:>@])], enable_nfsv41=$enableval, - enable_nfsv41=no) + enable_nfsv41=yes) if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) + AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv4.1 client support compiled in]) else enable_nfsv41= fi AC_SUBST(enable_nfsv41) AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) +AC_ARG_ENABLE(nfsvd41, + [AC_HELP_STRING([--enable-nfsdv41], + [enable for NFS v4.1 server support @<:@default=no@:>@])], + enable_nfsdv41=$enableval, + enable_nfsvd41=no) + if test "$enable_nfsdv41" = yes; then + AC_DEFINE(NFSD41_SUPPORTED, 1, [Define this if you want NFSv4.1 server support compiled in]) + else + enable_nfsdv41= + fi + AC_SUBST(enable_nfsdv41) + AM_CONDITIONAL(CONFIG_NFSDV41, [test "$enable_nfsdv41" = "yes"]) + AC_ARG_ENABLE(gss, [AC_HELP_STRING([--enable-gss], [enable support for rpcsec_gss @<:@default=yes@:>@])],support/include/nfs/nfs.h +1
-1@@ -16,7 +16,7 @@#define NFSD_MAXVERS 4#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED +#ifdef NFSD41_SUPPORTED #define NFSD_MAXMINORVERS4 1#else #define NFSD_MAXMINORVERS4 0Signature · 6 lines
1.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · J. Bruce Fields
Quoted 2 lines · Steve Dickson
Separate the v4.1 support in the client and server by creating the --enable-nfsdv4 configuration option.
I really dislike --enable-nfsdv4: people shouldn't have to rebuild nfs-utils in order to turn on server 4.1 support. They should be able to do that at run time.
Quoted 7 lines
It makes sense for something like the block client, because there we actually have to decide whether to *build* something or not, and if someone knows they're never going to use that daemon, maybe they don't want to bother building and installing it.
For server 4.1 support, we're making them rebuild just to change the value of a single constant. Why?
If I remember correctly, that's the way you wanted... We disabled 4.1 server supported this way, because the code did not conform to the RFC. This was done back in Fed 2010.
All this patch is doing is reorganizing things so there is a configuration option to enable/disable the 4.1 client.
Now, I agree. Enabling/disabling the 4.1 server in a more dynamic way would be good... Is the code ready for that? Should this constraint be remove completely?
steved.
Quoted 68 lines
--b.
Quoted 65 lines
Signed-off-by Steve Dickson <[email protected]>--- configure.ac | 19 ++++++++++++++++--- support/include/nfs/nfs.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-)configure.ac +16
-3@@ -75,17 +75,30 @@ AC_ARG_ENABLE(nfsv4, AC_ARG_ENABLE(nfsv41, [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], + [enable for NFS v4.1 client support @<:@default=yes@:>@])], enable_nfsv41=$enableval, - enable_nfsv41=no) + enable_nfsv41=yes) if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) + AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv4.1 client support compiled in]) else enable_nfsv41= fi AC_SUBST(enable_nfsv41) AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) +AC_ARG_ENABLE(nfsvd41, + [AC_HELP_STRING([--enable-nfsdv41], + [enable for NFS v4.1 server support @<:@default=no@:>@])], + enable_nfsdv41=$enableval, + enable_nfsvd41=no) + if test "$enable_nfsdv41" = yes; then + AC_DEFINE(NFSD41_SUPPORTED, 1, [Define this if you want NFSv4.1 server support compiled in]) + else + enable_nfsdv41= + fi + AC_SUBST(enable_nfsdv41) + AM_CONDITIONAL(CONFIG_NFSDV41, [test "$enable_nfsdv41" = "yes"]) + AC_ARG_ENABLE(gss, [AC_HELP_STRING([--enable-gss], [enable support for rpcsec_gss @<:@default=yes@:>@])],support/include/nfs/nfs.h +1
-1@@ -16,7 +16,7 @@#define NFSD_MAXVERS 4#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED +#ifdef NFSD41_SUPPORTED #define NFSD_MAXMINORVERS4 1#else #define NFSD_MAXMINORVERS4 0Signature · 6 lines
1.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 22 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
Quoted 2 lines · Steve Dickson
Separate the v4.1 support in the client and server by creating the --enable-nfsdv4 configuration option.
I really dislike --enable-nfsdv4: people shouldn't have to rebuild nfs-utils in order to turn on server 4.1 support. They should be able to do that at run time.
Quoted 7 lines
It makes sense for something like the block client, because there we actually have to decide whether to *build* something or not, and if someone knows they're never going to use that daemon, maybe they don't want to bother building and installing it.
For server 4.1 support, we're making them rebuild just to change the value of a single constant. Why?
If I remember correctly, that's the way you wanted... We disabled 4.1 server supported this way, because the code did not conform to the RFC. This was done back in Fed 2010.
Quoted 6 lines
All this patch is doing is reorganizing things so there is a configuration option to enable/disable the 4.1 client.
Now, I agree. Enabling/disabling the 4.1 server in a more dynamic way would be good... Is the code ready for that? Should this constraint be remove completely?
We still don't want it on by default. But that's no reason to force early adopters to recompile nfs-utils just to turn it on.
So how about something like this? (Untested.)
--b.
commit 3df526795eed38b27fecb51775c039b7eaeed088
Author: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500
nfsd: allow choosing server 41 support at runtime
Provide an enable-41 option to rpc.nfsd to turn on experimental 4.1 support in the server. (Current kernels have 41 off by default until basic 41 support is finished, so this option is intended only for people that know what they're doing.)
Note once 4.1 defaults to on, this option will become unnecessary (and can probably just be dropped from nfs-utils), and only the -N 4.1 option will be necessary, for those that want to turn 4.1 off for some reason.
configure.ac +0 -13
@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"]) -AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) - AC_ARG_ENABLE(gss, [AC_HELP_STRING([--enable-gss], [enable support for rpcsec_gss @<:@default=yes@:>@])],
support/include/nfs/nfs.h +0 -7
@@ -15,13 +15,6 @@#define NFSD_MINVERS 2#define NFSD_MAXVERS 4 -#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED -#define NFSD_MAXMINORVERS4 1 -#else -#define NFSD_MAXMINORVERS4 0 -#endif -struct nfs_fh_len {int fh_size;u_int8_t fh_handle[NFS3_FHSIZE ];
utils/nfsd/nfsd.c +13 -4
@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };
@@ -94,7 +95,7 @@ main(int argc, char **argv)char *p, *progname, *port;char *haddr =NULL ;int socket_up =0 ; -int minorvers4 =NFSD_MAXMINORVERS4 ;/* nfsv4 minor version */ +int minorvers41 =0 ;/* nfsv4 minor version */ unsigned int versbits =NFSCTL_ALLBITS ;unsigned int protobits =NFSCTL_ALLBITS ;unsigned int proto4 =0 ;
@@ -154,7 +155,12 @@ main(int argc, char **argv)switch ((c =strtol (optarg, &p,0 ))) {case 4 :if (*p =='.' ) { - minorvers4 = -atoi (p +1 ); +int i =atoi (p+1 ); +if (i !=1 ) { +fprintf (stderr,"%s: unsupported minor version\n" , optarg); +exit (1 ); + } + minorvers41 =-1 ;break ; }case 3 :
@@ -176,6 +182,9 @@ main(int argc, char **argv)case 'U' :NFSCTL_UDPUNSET (protobits);break ; +case 'X' : + minorvers41 =1 ; +break ;default :fprintf (stderr,"Invalid argument: '%c'\n" , c);case 'h' :
@@ -251,7 +260,7 @@ main(int argc, char **argv)* registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ -nfssvc_setvers (versbits, minorvers4); +nfssvc_setvers (versbits, minorvers41); error =nfssvc_set_sockets (AF_INET , proto4, haddr, port);if (!error)
@@ -303,7 +312,7 @@ static void usage(const char *prog) {fprintf (stderr,"Usage:\n" -"%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] nrservs\n" , +"%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [--enable-41] nrservs\n" , prog);exit (2 ); }
utils/nfsd/nfssvc.c +4 -6
@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits, }void -nfssvc_setvers (unsigned int ctlbits,int minorvers4) +nfssvc_setvers (unsigned int ctlbits,int minorvers41) {int fd, n, off;char *ptr;
@@ -280,11 +280,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers4)if (fd <0 )return ; - n = minorvers4 >=0 ? minorvers4 : -minorvers4; -if (n >=NFSD_MINMINORVERS4 && n <=NFSD_MAXMINORVERS4 ) - off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.%d " , - minorvers4 >0 ?'+' :'-' , - n); +if (minorvers41) + off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.1" , + minorvers41 >0 ?'+' :'-' );for (n =NFSD_MINVERS ; n <=NFSD_MAXVERS ; n++) {if (NFSCTL_VERISSET (ctlbits, n)) off +=snprintf (ptr+off,sizeof (buf) - off,"+%d " , n);
Quoted 26 lines · J. Bruce Fields
Quoted 25 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
Quoted 2 lines · Steve Dickson
Separate the v4.1 support in the client and server by creating the --enable-nfsdv4 configuration option.
I really dislike --enable-nfsdv4: people shouldn't have to rebuild nfs-utils in order to turn on server 4.1 support. They should be able to do that at run time.
Quoted 7 lines
It makes sense for something like the block client, because there we actually have to decide whether to *build* something or not, and if someone knows they're never going to use that daemon, maybe they don't want to bother building and installing it.
For server 4.1 support, we're making them rebuild just to change the value of a single constant. Why?
If I remember correctly, that's the way you wanted... We disabled 4.1 server supported this way, because the code did not conform to the RFC. This was done back in Fed 2010.
All this patch is doing is reorganizing things so there is a configuration option to enable/disable the 4.1 client.
Quoted 6 lines
Quoted 3 lines
Now, I agree. Enabling/disabling the 4.1 server in a more dynamic way would be good... Is the code ready for that? Should this constraint be remove completely?
We still don't want it on by default. But that's no reason to force early adopters to recompile nfs-utils just to turn it on.
Fine...
Quoted 33 lines
So how about something like this? (Untested.)
--b.
commit
3df526795eed38b27fecb51775c039b7eaeed088Author: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500nfsd: allow choosing server 41 support at runtime
Provide an enable-41 option to rpc.nfsd to turn on experimental 4.1 support in the server. (Current kernels have 41 off by default until basic 41 support is finished, so this option is intended only for people that know what they're doing.)
Note once 4.1 defaults to on, this option will become unnecessary (and can probably just be dropped from nfs-utils), and only the -N 4.1 option will be necessary, for those that want to turn 4.1 off for some reason.
Signed-off-by J. Bruce Fields <[email protected]>configure.ac +0
-3@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"]) -AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])],
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 10 lines
configure.ac +0
-10- enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -
I think we still need this for the 4.1 client code.
Quoted 26 lines
configure.ac +0
-0AC_ARG_ENABLE(gss, [AC_HELP_STRING([--enable-gss], [enable support for rpcsec_gss @<:@default=yes@:>@])],support/include/nfs/nfs.h +0
-7@@ -15,13 +15,6 @@#define NFSD_MINVERS 2#define NFSD_MAXVERS 4 -#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED -#define NFSD_MAXMINORVERS4 1 -#else -#define NFSD_MAXMINORVERS4 0 -#endif -struct nfs_fh_len {int fh_size;u_int8_t fh_handle[NFS3_FHSIZE ];utils/nfsd/nfsd.c +0
-0
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 6 lines
utils/nfsd/nfsd.c +1
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };
Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to /proc/fs/nfsd/versions to enable the support.
steved.
Quoted 80 lines
utils/nfsd/nfsd.c +12
-4@@ -94,7 +95,7 @@ main(int argc, char **argv)char *p, *progname, *port;char *haddr =NULL ;int socket_up =0 ; -int minorvers4 =NFSD_MAXMINORVERS4 ;/* nfsv4 minor version */ +int minorvers41 =0 ;/* nfsv4 minor version */ unsigned int versbits =NFSCTL_ALLBITS ;unsigned int protobits =NFSCTL_ALLBITS ;unsigned int proto4 =0 ;@@ -154,7 +155,12 @@ main(int argc, char **argv)switch ((c =strtol (optarg, &p,0 ))) {case 4 :if (*p =='.' ) { - minorvers4 = -atoi (p +1 ); +int i =atoi (p+1 ); +if (i !=1 ) { +fprintf (stderr,"%s: unsupported minor version\n" , optarg); +exit (1 ); + } + minorvers41 =-1 ;break ; }case 3 :@@ -176,6 +182,9 @@ main(int argc, char **argv)case 'U' :NFSCTL_UDPUNSET (protobits);break ; +case 'X' : + minorvers41 =1 ; +break ;default :fprintf (stderr,"Invalid argument: '%c'\n" , c);case 'h' :@@ -251,7 +260,7 @@ main(int argc, char **argv)* registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ -nfssvc_setvers (versbits, minorvers4); +nfssvc_setvers (versbits, minorvers41); error =nfssvc_set_sockets (AF_INET , proto4, haddr, port);if (!error)@@ -303,7 +312,7 @@ static void usage(const char *prog) {fprintf (stderr,"Usage:\n" -"%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] nrservs\n" , +"%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] [--enable-41] nrservs\n" , prog);exit (2 ); }utils/nfsd/nfssvc.c +4
-6@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits, }void -nfssvc_setvers (unsigned int ctlbits,int minorvers4) +nfssvc_setvers (unsigned int ctlbits,int minorvers41) {int fd, n, off;char *ptr;@@ -280,11 +280,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers4)if (fd <0 )return ; - n = minorvers4 >=0 ? minorvers4 : -minorvers4; -if (n >=NFSD_MINMINORVERS4 && n <=NFSD_MAXMINORVERS4 ) - off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.%d " , - minorvers4 >0 ?'+' :'-' , - n); +if (minorvers41) + off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.1" , + minorvers41 >0 ?'+' :'-' );for (n =NFSD_MINVERS ; n <=NFSD_MAXVERS ; n++) {if (NFSCTL_VERISSET (ctlbits, n)) off +=snprintf (ptr+off,sizeof (buf) - off,"+%d " , n);
Quoted 11 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
configure.ac +0
-0@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])
Quoted 14 lines
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 13 lines
configure.ac +0
-13-AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -I think we still need this for the 4.1 client code.
OK. Or I can wait and resend a patch after you've committed the changes for the client's block daemon, if you'd prefer.
Quoted 6 lines
Quoted 6 lines
utils/nfsd/nfsd.c +0
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' },
Quoted 8 lines
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 5 lines
utils/nfsd/nfsd.c +1
-0{ "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to
/proc/fs/nfsd/versionsto enable the support.
I think it's a reasonable thing to do for experimental code.
But we could do the following instead. (Warning: still untested.)
--b.
commit 8d69da4c556f8ad2d42caa3875a665761c27463e
Author: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500
nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options.
Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental).
support/include/nfs/nfs.h +0 -7
@@ -15,13 +15,6 @@#define NFSD_MINVERS 2#define NFSD_MAXVERS 4 -#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED -#define NFSD_MAXMINORVERS4 1 -#else -#define NFSD_MAXMINORVERS4 0 -#endif -struct nfs_fh_len {int fh_size;u_int8_t fh_handle[NFS3_FHSIZE ];
utils/nfsd/nfsd.c +8 -3
@@ -94,7 +94,7 @@ main(int argc, char **argv)char *p, *progname, *port;char *haddr =NULL ;int socket_up =0 ; -int minorvers4 =NFSD_MAXMINORVERS4 ;/* nfsv4 minor version */ +int minorvers41 =0 ;/* nfsv4 minor version */ unsigned int versbits =NFSCTL_ALLBITS ;unsigned int protobits =NFSCTL_ALLBITS ;unsigned int proto4 =0 ;
@@ -154,7 +154,12 @@ main(int argc, char **argv)switch ((c =strtol (optarg, &p,0 ))) {case 4 :if (*p =='.' ) { - minorvers4 = -atoi (p +1 ); +int i =atoi (p+1 ); +if (i !=1 ) { +fprintf (stderr,"%s: unsupported minor version\n" , optarg); +exit (1 ); + } + minorvers41 =-1 ;break ; }case 3 :
@@ -251,7 +256,7 @@ main(int argc, char **argv)* registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ -nfssvc_setvers (versbits, minorvers4); +nfssvc_setvers (versbits, minorvers41); error =nfssvc_set_sockets (AF_INET , proto4, haddr, port);if (!error)
utils/nfsd/nfssvc.c +4 -6
@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits, }void -nfssvc_setvers (unsigned int ctlbits,int minorvers4) +nfssvc_setvers (unsigned int ctlbits,int minorvers41) {int fd, n, off;char *ptr;
@@ -280,11 +280,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers4)if (fd <0 )return ; - n = minorvers4 >=0 ? minorvers4 : -minorvers4; -if (n >=NFSD_MINMINORVERS4 && n <=NFSD_MAXMINORVERS4 ) - off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.%d " , - minorvers4 >0 ?'+' :'-' , - n); +if (minorvers41) + off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.1" , + minorvers41 >0 ?'+' :'-' );for (n =NFSD_MINVERS ; n <=NFSD_MAXVERS ; n++) {if (NFSCTL_VERISSET (ctlbits, n)) off +=snprintf (ptr+off,sizeof (buf) - off,"+%d " , n);
Quoted 27 lines · J. Bruce Fields
Quoted 11 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
configure.ac +0
-0@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])Quoted 14 lines
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 13 lines
configure.ac +0
-13-AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -I think we still need this for the 4.1 client code.
Quoted 2 lines
OK. Or I can wait and resend a patch after you've committed the changes for the client's block daemon, if you'd prefer.
I'll deal with the configure code....
Quoted 28 lines
Quoted 15 lines
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 12 lines
utils/nfsd/nfsd.c +1
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to
/proc/fs/nfsd/versionsto enable the support.I think it's a reasonable thing to do for experimental code.
But we could do the following instead. (Warning: still untested.)
--b.
commit
8d69da4c556f8ad2d42caa3875a665761c27463eAuthor: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500nfsd: allow choosing server 41 support at runtime
Quoted 7 lines
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options.
Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental).
I think this is a good compromise... Could you spend a few cycles on making sure that echo does indeed turn on 4.1 support?
tia,
steved.
Quoted 85 lines
Signed-off-by J. Bruce Fields <[email protected]>support/include/nfs/nfs.h +0
-7@@ -15,13 +15,6 @@#define NFSD_MINVERS 2#define NFSD_MAXVERS 4 -#define NFSD_MINMINORVERS4 1 -#ifdef NFS41_SUPPORTED -#define NFSD_MAXMINORVERS4 1 -#else -#define NFSD_MAXMINORVERS4 0 -#endif -struct nfs_fh_len {int fh_size;u_int8_t fh_handle[NFS3_FHSIZE ];utils/nfsd/nfsd.c +8
-3@@ -94,7 +94,7 @@ main(int argc, char **argv)char *p, *progname, *port;char *haddr =NULL ;int socket_up =0 ; -int minorvers4 =NFSD_MAXMINORVERS4 ;/* nfsv4 minor version */ +int minorvers41 =0 ;/* nfsv4 minor version */ unsigned int versbits =NFSCTL_ALLBITS ;unsigned int protobits =NFSCTL_ALLBITS ;unsigned int proto4 =0 ;@@ -154,7 +154,12 @@ main(int argc, char **argv)switch ((c =strtol (optarg, &p,0 ))) {case 4 :if (*p =='.' ) { - minorvers4 = -atoi (p +1 ); +int i =atoi (p+1 ); +if (i !=1 ) { +fprintf (stderr,"%s: unsupported minor version\n" , optarg); +exit (1 ); + } + minorvers41 =-1 ;break ; }case 3 :@@ -251,7 +256,7 @@ main(int argc, char **argv)* registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ -nfssvc_setvers (versbits, minorvers4); +nfssvc_setvers (versbits, minorvers41); error =nfssvc_set_sockets (AF_INET , proto4, haddr, port);if (!error)utils/nfsd/nfssvc.c +4
-6@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits, }void -nfssvc_setvers (unsigned int ctlbits,int minorvers4) +nfssvc_setvers (unsigned int ctlbits,int minorvers41) {int fd, n, off;char *ptr;@@ -280,11 +280,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers4)if (fd <0 )return ; - n = minorvers4 >=0 ? minorvers4 : -minorvers4; -if (n >=NFSD_MINMINORVERS4 && n <=NFSD_MAXMINORVERS4 ) - off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.%d " , - minorvers4 >0 ?'+' :'-' , - n); +if (minorvers41) + off +=snprintf (ptr+off,sizeof (buf) - off,"%c4.1" , + minorvers41 >0 ?'+' :'-' );for (n =NFSD_MINVERS ; n <=NFSD_MAXVERS ; n++) {if (NFSCTL_VERISSET (ctlbits, n)) off +=snprintf (ptr+off,sizeof (buf) - off,"+%d " , n);
Quoted 65 lines · Steve Dickson
Quoted 27 lines · J. Bruce Fields
Quoted 11 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
configure.ac +0
-0@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])Quoted 14 lines
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 13 lines
configure.ac +0
-13-AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -I think we still need this for the 4.1 client code.
Quoted 2 lines
OK. Or I can wait and resend a patch after you've committed the changes for the client's block daemon, if you'd prefer.
I'll deal with the configure code....
Quoted 31 lines
Quoted 15 lines
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 12 lines
utils/nfsd/nfsd.c +1
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to
/proc/fs/nfsd/versionsto enable the support.I think it's a reasonable thing to do for experimental code.
But we could do the following instead. (Warning: still untested.)
--b.
commit
8d69da4c556f8ad2d42caa3875a665761c27463eAuthor: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options.
Quoted 6 lines
Quoted 4 lines
Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental).
I think this is a good compromise... Could you spend a few cycles on making sure that echo does indeed turn on 4.1 support?
Yep, will do.
--b.
Quoted 66 lines · J. Bruce Fields
Quoted 65 lines · Steve Dickson
Quoted 27 lines · J. Bruce Fields
Quoted 11 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
configure.ac +0
-0@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])Quoted 14 lines
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 13 lines
configure.ac +0
-13-AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -I think we still need this for the 4.1 client code.
Quoted 2 lines
OK. Or I can wait and resend a patch after you've committed the changes for the client's block daemon, if you'd prefer.
I'll deal with the configure code....
Quoted 31 lines
Quoted 15 lines
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 12 lines
utils/nfsd/nfsd.c +1
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to
/proc/fs/nfsd/versionsto enable the support.I think it's a reasonable thing to do for experimental code.
But we could do the following instead. (Warning: still untested.)
--b.
commit
8d69da4c556f8ad2d42caa3875a665761c27463eAuthor: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental).
I think this is a good compromise... Could you spend a few cycles on making sure that echo does indeed turn on 4.1 support?
Yep, will do.
Done; that patch worked for me. Let me know if you need it resent.
--b.
Quoted 71 lines · J. Bruce Fields
Quoted 70 lines · J. Bruce Fields
Quoted 69 lines · Steve Dickson
Quoted 27 lines · J. Bruce Fields
Quoted 11 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
configure.ac +0
-0@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])Quoted 14 lines
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 13 lines
configure.ac +0
-13-AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -I think we still need this for the 4.1 client code.
Quoted 2 lines
OK. Or I can wait and resend a patch after you've committed the changes for the client's block daemon, if you'd prefer.
I'll deal with the configure code....
Quoted 35 lines
Quoted 15 lines
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 12 lines
utils/nfsd/nfsd.c +1
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to
/proc/fs/nfsd/versionsto enable the support.I think it's a reasonable thing to do for experimental code.
But we could do the following instead. (Warning: still untested.)
--b.
commit
8d69da4c556f8ad2d42caa3875a665761c27463eAuthor: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options.
Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental).
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
I think this is a good compromise... Could you spend a few cycles on making sure that echo does indeed turn on 4.1 support?
Yep, will do.
Done; that patch worked for me. Let me know if you need it resent.
No need... Its committed...
steved.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 74 lines · Steve Dickson
Quoted 71 lines · J. Bruce Fields
Quoted 70 lines · J. Bruce Fields
Quoted 69 lines · Steve Dickson
Quoted 27 lines · J. Bruce Fields
Quoted 11 lines · Steve Dickson
Quoted 8 lines · J. Bruce Fields
configure.ac +0
-0@@ -73,19 +73,6 @@ AC_ARG_ENABLE(nfsv4, AC_SUBST(enable_nfsv4) AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])Quoted 14 lines
configure.ac AC_ARG_ENABLE(nfsv4, · line 88
Quoted 13 lines
configure.ac +0
-13-AC_ARG_ENABLE(nfsv41, - [AC_HELP_STRING([--enable-nfsv41], - [enable support for NFSv41 @<:@default=no@:>@])], - enable_nfsv41=$enableval, - enable_nfsv41=no) - if test "$enable_nfsv41" = yes; then - AC_DEFINE(NFS41_SUPPORTED, 1, [Define this if you want NFSv41 support compiled in]) - else - enable_nfsv41= - fi - AC_SUBST(enable_nfsv41) - AM_CONDITIONAL(CONFIG_NFSV41, [test "$enable_nfsv41" = "yes"]) -I think we still need this for the 4.1 client code.
Quoted 2 lines
OK. Or I can wait and resend a patch after you've committed the changes for the client's block daemon, if you'd prefer.
I'll deal with the configure code....
Quoted 35 lines
Quoted 15 lines
utils/nfsd/nfsd.c static struct option longopts[] = · line 45
Quoted 12 lines
utils/nfsd/nfsd.c +1
-0@@ -40,6 +40,7 @@ static struct option longopts[] = { "port", 1, 0, 'p' }, { "debug", 0, 0, 'd' }, { "syslog", 0, 0, 's' }, + { "enable-41", 0, 0, 'X' }, { NULL, 0, 0, 0 } };Introducing temporary, undocumented command line arguments is generally not a good thing... IMHO... I was think more of an echo to
/proc/fs/nfsd/versionsto enable the support.I think it's a reasonable thing to do for experimental code.
But we could do the following instead. (Warning: still untested.)
--b.
commit
8d69da4c556f8ad2d42caa3875a665761c27463eAuthor: J. Bruce Fields <[email protected]> Date: Thu Dec 17 17:11:54 2009 -0500nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code explicitly turns it on or off anyway, depending on configure options.
Instead, just leave 4.1 support alone. This allows a user to add an "echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want. Otherwise they will get the kernel's default (currently to leave 4.1 off, as long as 4.1 support is experimental).
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
I think this is a good compromise... Could you spend a few cycles on making sure that echo does indeed turn on 4.1 support?
Yep, will do.
Done; that patch worked for me. Let me know if you need it resent.
No need... Its committed...
Thanks!--b.