All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Steve Dickson <steved@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 1/3] gssd_proc: use pollsize, not FD_ALLOC_BLOCK, in get_poll_index().
Date: Wed, 28 Nov 2012 12:11:22 +1100	[thread overview]
Message-ID: <20121128011122.2475.42464.stgit@notabene.brown> (raw)
In-Reply-To: <20121128010939.2475.13123.stgit@notabene.brown>

get_poll_index wants to walk the entire "pollarray", but uses
the constant FD_ALLOC_BLOCK, rather than the variable
pollsize (which has the same value).  If we want to make the
size of the array variable, it is best not to use the constant.

As pollsize is 'unsigned long', 'i' should be too.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 utils/gssd/gssd_proc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
index ec251fa..2d7ec94 100644
--- a/utils/gssd/gssd_proc.c
+++ b/utils/gssd/gssd_proc.c
@@ -398,10 +398,10 @@ process_clnt_dir_files(struct clnt_info * clp)
 static int
 get_poll_index(int *ind)
 {
-	int i;
+	unsigned int i;
 
 	*ind = -1;
-	for (i=0; i<FD_ALLOC_BLOCK; i++) {
+	for (i=0; i<pollsize; i++) {
 		if (pollarray[i].events == 0) {
 			*ind = i;
 			break;



  reply	other threads:[~2012-11-28  1:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28  1:11 [PATCH 0/3] Make size of gssd_proc fd array a little more dynamic Neil Brown
2012-11-28  1:11 ` Neil Brown [this message]
2012-11-28  1:11 ` [PATCH 2/3] gssd_proc: remove pointless test against FD_ALLOC_BLOCK in process_pipedir Neil Brown
2012-11-28  1:11 ` [PATCH 3/3] gssd: base the size of the fd array on the RLIMIT_NOFILE limit Neil Brown
2012-11-28 13:10   ` J. Bruce Fields
2012-11-29  0:30     ` NeilBrown
2012-12-11  0:02       ` NeilBrown
2012-12-11 16:16         ` J. Bruce Fields
2012-12-13  6:03           ` NeilBrown
2012-12-13 19:21             ` J. Bruce Fields
2012-11-28 19:54 ` [PATCH 0/3] Make size of gssd_proc fd array a little more dynamic Steve Dickson

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=20121128011122.2475.42464.stgit@notabene.brown \
    --to=neilb@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.