Re: [PATCH 13/17] NSM: Make sure to return an error if the SM_MON call result is not zero

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

 



On Thu, Dec 04, 2008 at 02:21:15PM -0500, Chuck Lever wrote:
> The nsm_monitor() function reports an error and does not set sm_monitored
> if the SM_MON upcall reply has a non-zero result code, but nsm_monitor()
> does not return an error to its caller in this case.
> 
> Since sm_monitored is not set, the upcall is retried when the next NLM
> request invokes nsm_monitor().  However, that may not come for a while.
> In the meantime, at least one NLM request will potentially proceed
> without the peer being monitored properly.
> 
> Have nsm_monitor() return an error if the result code is non-zero.
> This will cause all NLM requests to fail immediately if the upcall
> completed successfully but rpc.statd returned an error.
> 
> This may be inconvenient in some cases (for example if rpc.statd
> cannot complete a proper DNS reverse lookup of the hostname), but will
> make the reboot monitoring service more robust by forcing such issues
> to be corrected by an admin.

OK, thanks for the additional explanation.

--b.

> 
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> ---
> 
>  fs/lockd/mon.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
> index bb5fc1b..07e16b8 100644
> --- a/fs/lockd/mon.c
> +++ b/fs/lockd/mon.c
> @@ -91,8 +91,9 @@ nsm_monitor(struct nlm_host *host)
>  	nsm->sm_mon_name = nsm_use_hostnames ? nsm->sm_name : nsm->sm_addrbuf;
>  
>  	status = nsm_mon_unmon(nsm, SM_MON, &res);
> -
> -	if (status < 0 || res.status != 0)
> +	if (res.status != 0)
> +		status = -EIO;
> +	if (status < 0)
>  		printk(KERN_NOTICE "lockd: cannot monitor %s\n", nsm->sm_name);
>  	else
>  		nsm->sm_monitored = 1;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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