Re: [PATCH v3] nfsd: Log error on UMH upcall init failure and debug message on success

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 12, 2021 at 06:09:44PM +0100, Paul Menzel wrote:
> By default, using `printk()`, Linux logs messages with level warning,
> which leaves the user reading
> 
>     NFSD: Using UMH upcall client tracking operations.
> 
> wondering what to do about it. Reading `nfsd4_umh_cltrack_init()`, the
> message is actually logged on success, so nothing needs to be done, and
> it was decided to use the debug level.
> 
> Additionally, Linux now logs an error on init failure.
> 
>     NFSD: Failed to init UMH upcall client tracking operations.

The thing is, it's actually trying a series of different mechanisms (see
nfsd4_client_tracking_init) and taking the first one that works.  It's
more useful to see which one of them ends up being chosen rather than
the list of mechanisms that failed.  (And those failures are normal if
userland is configured to use something lower down in the list.)

So, let's just demote to "debug" and leave the logic otherwise
unchanged.

--b.

> 
> Cc: linux-nfs@xxxxxxxxxxxxxxx
> Signed-off-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
> ---
> v2: Log error and demote success message to debug-level (forgot `-a` in `git commit --amend`)
> v3: Actually sent correct diff
> 
>  fs/nfsd/nfs4recover.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
> index 891395c6c7d3..fff89c739033 100644
> --- a/fs/nfsd/nfs4recover.c
> +++ b/fs/nfsd/nfs4recover.c
> @@ -1863,8 +1863,11 @@ nfsd4_umh_cltrack_init(struct net *net)
>  
>  	ret = nfsd4_umh_cltrack_upcall("init", NULL, grace_start, NULL);
>  	kfree(grace_start);
> -	if (!ret)
> -		printk("NFSD: Using UMH upcall client tracking operations.\n");
> +	if (ret)
> +		pr_debug("NFSD: Using UMH upcall client tracking operations.\n");
> +	else
> +		pr_err("NFSD: Failed to init UMH upcall client tracking operations.");
> +
>  	return ret;
>  }
>  
> -- 
> 2.30.2



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux