[nfs-utils PATCH] nfsd: don't assume service is running when setting thread count to 0
Scott Mayhew <[email protected]>
| Newsgroups | gmane.linux.nfs |
|---|---|
| Message-ID | <[email protected]> |
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(-) diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index 365e145d..c95d32f4 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -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; + } } } -- 2.54.0