Linux NFS development
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Steve Dickson <steved@redhat.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [nfs-utils PATCH] statd: make statd_canonical_name emit a warning if the presentation address maps to an empty hostname
Date: Mon, 7 Dec 2015 12:04:15 -0500	[thread overview]
Message-ID: <20151207170414.GI4405@tonberry.usersys.redhat.com> (raw)
In-Reply-To: <9457C117-431E-40ED-9A3A-5EBE866C7BAF@oracle.com>

On Mon, 07 Dec 2015, Chuck Lever wrote:

> 
> > On Dec 7, 2015, at 11:42 AM, Scott Mayhew <smayhew@redhat.com> wrote:
> > 
> > Certain name resolution misconfigurations (for example, a hosts file
> > entry with an ip address but no hostnames) can cause get_nameinfo() to
> > return an empty string in buf, which will lead to this cryptic failure:
> > 
> > Dec  7 09:37:44 hostname rpc.statd[8024]: Failed to insert: creating
> > /var/lib/nfs/statd/sm/: Is a directory
> > Dec  7 09:37:44 hostname rpc.statd[8024]: STAT_FAIL to
> > hostname.example.com for SM_MON of 192.168.1.2
> > Dec  7 09:37:44 hostname kernel: lockd: cannot monitor 192.168.1.2
> > 
> > It's better in that case to just go ahead and use the presentation
> > address and log a more helpful warning:
> 
> Doesn???t this change wire behavior? Some peers do not appreciate
> receiving a presentation address, which is why statd/sm_notify
> avoid sending them.

I was just trying to keep it in line with the behavior you had added in
e22f5a9c (statd: statd fails to monitor if no reverse mapping of mon_name
exists).  As it stands now, if get_nameinfo() fails outright then the
presentation address is used and we're able to monitor the peer just
fine... but get_nameinfo() succeeds and returns an empty hostname then
we ultimately wind up failing to monitor the peer.
> 
> I think it would be better to _skip_ this address and print the
> warning? IMO.
> 
That's actually what I had at first and if you think that's better then
that's fine too.  The rest of the errors would still get logged then,
but at least the reason would be a little more apparent.

-Scott
> 
> > Dec  7 10:24:52 hostname rpc.statd[14224]: get_nameinfo returned empty
> > hostname for 10.10.183.219.  Fix your name resolution!
> > 
> > Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> > ---
> > utils/statd/hostname.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> > 
> > diff --git a/utils/statd/hostname.c b/utils/statd/hostname.c
> > index c61087c..86d11ca 100644
> > --- a/utils/statd/hostname.c
> > +++ b/utils/statd/hostname.c
> > @@ -211,6 +211,12 @@ statd_canonical_name(const char *hostname)
> > 			/* OK to use presentation address,
> > 			 * if no reverse map exists */
> > 			return strdup(hostname);
> > +		else if (buf[0] == '\0') {
> > +			xlog_warn("get_nameinfo returned empty hostname for "
> > +					"%s. Fix your name resolution!",
> > +					hostname);
> > +			return strdup(hostname);
> > +		}
> > 		return strdup(buf);
> > 	}
> > 
> > -- 
> > 2.4.3
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> Chuck Lever
> 
> 
> 
> 

  reply	other threads:[~2015-12-07 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 16:42 [nfs-utils PATCH] statd: make statd_canonical_name emit a warning if the presentation address maps to an empty hostname Scott Mayhew
2015-12-07 16:46 ` Chuck Lever
2015-12-07 17:04   ` Scott Mayhew [this message]
2015-12-07 17:19     ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151207170414.GI4405@tonberry.usersys.redhat.com \
    --to=smayhew@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox