linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: NeilBrown <neilb@suse.de>
Cc: NFS <linux-nfs@vger.kernel.org>,
	Leonardo Chiquitto <lchiquitto@suse.com>
Subject: Re: [PATCH - nfs-utils] gssd:  use correct test for success of getrlimit()
Date: Mon, 25 Mar 2013 10:15:40 -0400	[thread overview]
Message-ID: <51505C0C.7080906@RedHat.com> (raw)
In-Reply-To: <20130219113102.265d9d03@notabene.brown>



On 18/02/13 19:31, NeilBrown wrote:
> 
> commit 7c5cb5e732a4b8704f8c79ec819c5d271e040339
>     gssd: base the size of the fd array on the RLIMIT_NOFILE limit.
> 
> didn't actually work as claimed.  It only uses the returned value
> if getrlimit() returns -1  -- which of course it only does when
> there was an error.
> 
> So change the test to "== 0".
> 
> Reported-by: Leonardo Chiquitto< lchiquitto@suse.com>
> Signed-off-by: NeilBrown <neilb@suse.de>
> 
> --
> hangs head in shame .... NeilBrown
Committed... 

steved.

> 
> diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
> index c17ab3b..e10bda6 100644
> --- a/utils/gssd/gssd_proc.c
> +++ b/utils/gssd/gssd_proc.c
> @@ -477,7 +477,7 @@ init_client_list(void)
>  	TAILQ_INIT(&clnt_list);
>  	/* Eventually plan to grow/shrink poll array: */
>  	pollsize = FD_ALLOC_BLOCK;
> -	if (getrlimit(RLIMIT_NOFILE, &rlim) < 0 &&
> +	if (getrlimit(RLIMIT_NOFILE, &rlim) == 0 &&
>  	    rlim.rlim_cur != RLIM_INFINITY)
>  		pollsize = rlim.rlim_cur;
>  	pollarray = calloc(pollsize, sizeof(struct pollfd));
> 

      reply	other threads:[~2013-03-25 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19  0:31 [PATCH - nfs-utils] gssd: use correct test for success of getrlimit() NeilBrown
2013-03-25 14:15 ` 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=51505C0C.7080906@RedHat.com \
    --to=steved@redhat.com \
    --cc=lchiquitto@suse.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).