linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] Revert "mountd: handle allocation failures in auth_unix_ip upcall"
Date: Wed, 28 Nov 2012 09:39:50 -0500	[thread overview]
Message-ID: <50B62236.3080208@RedHat.com> (raw)
In-Reply-To: <20121127213127.GH27142@fieldses.org>



On 27/11/12 16:31, J. Bruce Fields wrote:
> On Mon, Nov 26, 2012 at 05:51:16PM -0500, J. Bruce Fields wrote:
> commit dfb31d861261c8461a2dc4fb7e8823f5169a9079
> Author: J. Bruce Fields <bfields@redhat.com>
> Date:   Tue Nov 27 16:10:41 2012 -0500
> 
>     mountd: auth_unix_ip should downcall on error to prevent hangs
>     
>     Since bf6a4febaa78bf188896b7b5b02c46562dd08b70 "mountd: handle
>     allocation failures in auth_unix_ip upcall", a failure to map the
>     address of an incoming client to a name could result in a hang.
>     
>     We should be responding with an error in the case, not just skipping the
>     downcall and leaving everybody hanging.
>     
>     Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Committed.... 

steved.
> 
> diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
> index e950ec6..c13f305 100644
> --- a/utils/mountd/cache.c
> +++ b/utils/mountd/cache.c
> @@ -109,12 +109,10 @@ static void auth_unix_ip(FILE *f)
>  		struct addrinfo *ai = NULL;
>  
>  		ai = client_resolve(tmp->ai_addr);
> -		if (ai == NULL)
> -			goto out;
> -		client = client_compose(ai);
> -		freeaddrinfo(ai);
> -		if (!client)
> -			goto out;
> +		if (ai) {
> +			client = client_compose(ai);
> +			freeaddrinfo(ai);
> +		}
>  	}
>  	qword_print(f, "nfsd");
>  	qword_print(f, ipaddr);
> @@ -127,7 +125,6 @@ static void auth_unix_ip(FILE *f)
>  	xlog(D_CALL, "auth_unix_ip: client %p '%s'", client, client?client: "DEFAULT");
>  
>  	free(client);
> -out:
>  	freeaddrinfo(tmp);
>  
>  }
> 

      parent reply	other threads:[~2012-11-28 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 22:03 [PATCH] Revert "mountd: handle allocation failures in auth_unix_ip upcall" J. Bruce Fields
2012-11-26 22:05 ` Chuck Lever
2012-11-26 22:15   ` J. Bruce Fields
2012-11-26 22:38     ` Chuck Lever
2012-11-26 22:51       ` J. Bruce Fields
2012-11-26 23:10         ` Chuck Lever
2012-11-27 14:23         ` Steve Dickson
2012-11-27 21:31         ` J. Bruce Fields
2012-11-27 21:33           ` Chuck Lever
2012-11-28 14:39           ` Steve Dickson [this message]

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=50B62236.3080208@RedHat.com \
    --to=steved@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).