nfs-utils: Fix version setting by config for vers4
Subsystems (2)
PATCH 1/1 nfs-utils: Fix version setting by config for vers4
The code path for setting major versions via nfs.conf was not the same as setting it by cli option, resulting in vers4=n not working unless vers4.0=n was also set
Signed-off-by Justin Mitchell <[email protected]>
--- utils/nfsd/nfsd.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
utils/nfsd/nfsd.c +12 -3
@@ -83,6 +83,9 @@ main(int argc, char **argv)conf_init_file (NFS_CONFFILE );xlog_from_conffile ("nfsd" ); + +nfssvc_get_minormask (&minormask); + count =conf_get_num ("nfsd" ,"threads" , count); grace =conf_get_num ("nfsd" ,"grace-time" , grace); lease =conf_get_num ("nfsd" ,"lease-time" , lease);
@@ -101,13 +104,19 @@ main(int argc, char **argv)for (i =2 ; i <=4 ; i++) {char tag[20 ];sprintf (tag,"vers%d" , i); -if (conf_get_bool ("nfsd" , tag,NFSCTL_VERISSET (versbits, i))) +if (conf_get_bool ("nfsd" , tag,NFSCTL_VERISSET (versbits, i))) {NFSCTL_VERSET (versbits, i); -else +if (i ==4 ) + minorvers = minorversset = minormask; + }else {NFSCTL_VERUNSET (versbits, i); +if (i ==4 ) { + minorvers =0 ; + minorversset = minormask; + } + } } -nfssvc_get_minormask (&minormask);/* We assume the kernel will default all minor versions to 'on', * and allow the config file to disable some. */
Signature · 1 line
1.8.3.1
Quoted 8 lines · Justin Mitchell
The code path for setting major versions via nfs.conf was not the same as setting it by cli option, resulting in vers4=n not working unless vers4.0=n was also set
Signed-off-by Justin Mitchell <[email protected]>--- utils/nfsd/nfsd.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
Committed....
steved.
Quoted 39 lines
utils/nfsd/nfsd.c +12
-3@@ -83,6 +83,9 @@ main(int argc, char **argv)conf_init_file (NFS_CONFFILE );xlog_from_conffile ("nfsd" ); + +nfssvc_get_minormask (&minormask); + count =conf_get_num ("nfsd" ,"threads" , count); grace =conf_get_num ("nfsd" ,"grace-time" , grace); lease =conf_get_num ("nfsd" ,"lease-time" , lease);@@ -101,13 +104,19 @@ main(int argc, char **argv)for (i =2 ; i <=4 ; i++) {char tag[20 ];sprintf (tag,"vers%d" , i); -if (conf_get_bool ("nfsd" , tag,NFSCTL_VERISSET (versbits, i))) +if (conf_get_bool ("nfsd" , tag,NFSCTL_VERISSET (versbits, i))) {NFSCTL_VERSET (versbits, i); -else +if (i ==4 ) + minorvers = minorversset = minormask; + }else {NFSCTL_VERUNSET (versbits, i); +if (i ==4 ) { + minorvers =0 ; + minorversset = minormask; + } + } } -nfssvc_get_minormask (&minormask);/* We assume the kernel will default all minor versions to 'on', * and allow the config file to disable some. */