nfsd: don't assume service is running when setting thread count to 0
Subsystems (2)
PATCH 1/1 nfsd: don't assume service is running when setting thread count to 0
Newer kernels return -EIO if you try to write to /proc/fs/nfsd/threads and there are no active listeners.
Signed-off-by Scott Mayhew <[email protected]>
--- utils/nfsd/nfsd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
utils/nfsd/nfsd.c +10 -6
@@ -311,12 +311,16 @@ main(int argc, char **argv) argv[0], count); count =1 ; }else if (count ==0 ) { -/* -* don't bother setting anything else if the threads -* are coming down anyway. -*/ - socket_up =1 ; - goto set_threads; +if (nfssvc_inuse ()) { +/* +* don't bother setting anything else if the threads +* are coming down anyway. +*/ + socket_up =1 ; + goto set_threads; + }else { + goto out; + } } }
Signature · 1 line
2.54.0
Quoted 4 lines · Scott Mayhew
Newer kernels return
-EIOif you try to write to/proc/fs/nfsd/threadsand there are no active listeners.Signed-off-by Scott Mayhew <[email protected]>
Committed...
steved.
Quoted 31 lines
--- utils/nfsd/nfsd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)utils/nfsd/nfsd.c +10
-6@@ -311,12 +311,16 @@ main(int argc, char **argv) argv[0], count); count =1 ; }else if (count ==0 ) { -/* -* don't bother setting anything else if the threads -* are coming down anyway. -*/ - socket_up =1 ; - goto set_threads; +if (nfssvc_inuse ()) { +/* +* don't bother setting anything else if the threads +* are coming down anyway. +*/ + socket_up =1 ; + goto set_threads; + }else { + goto out; + } } }