Re: [nfs-utils PATCH] nfsd: don't assume service is running when setting thread count to 0

Steve Dickson <[email protected]>
Newsgroups gmane.linux.nfs
Message-ID <[email protected]>

On 6/8/26 9:13 AM, Scott Mayhew wrote:
> 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]>
Committed...

steved.
> ---
>   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;
> +			}
>   		}
>   	}
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.