From: "J. Bruce Fields" <bfields@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Steve Dickson <SteveD@redhat.com>, Jim Rees <rees@umich.edu>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH 4/4] rpc.gssd: don't call poll() twice a second.
Date: Tue, 31 Jul 2012 17:27:45 -0400 [thread overview]
Message-ID: <20120731212744.GC1826@pad.fieldses.org> (raw)
In-Reply-To: <9C74193E-FB49-48C3-A828-50EDE37C95AD@oracle.com>
On Tue, Jul 31, 2012 at 02:23:36PM -0700, Chuck Lever wrote:
>
> On Jul 31, 2012, at 2:00 PM, J. Bruce Fields wrote:
>
> > From: "J. Bruce Fields" <bfields@redhat.com>
> >
> > Use ppoll instead.
> >
> > (This breaks compatibility with kernels before 2.6.16 and glibc before
> > 2.4).
>
> I think I prefer seeing this wrapped with some autoconf machinery to allow nfs-utils to continue to build on earlier systems.
I was assuming we could drop support for older systems.
If not, then'd I'd much prefer to go back to the self-pipe trick than to
deal with autoconf and ifdef'ing out all this stuff.
--b.
>
> > Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> > ---
> > utils/gssd/gssd_main_loop.c | 12 +++++-------
> > 1 file changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/utils/gssd/gssd_main_loop.c b/utils/gssd/gssd_main_loop.c
> > index 142c8c5..2d20fa2 100644
> > --- a/utils/gssd/gssd_main_loop.c
> > +++ b/utils/gssd/gssd_main_loop.c
> > @@ -186,13 +186,14 @@ gssd_run()
> > struct sigaction dn_act = {
> > .sa_handler = dir_notify_handler
> > };
> > - sigset_t set;
> > + sigset_t set, emptyset;
> >
> > sigemptyset(&dn_act.sa_mask);
> > sigaction(DNOTIFY_SIGNAL, &dn_act, NULL);
> >
> > - /* just in case the signal is blocked... */
> > + sigemptyset(&emptyset);
> > sigemptyset(&set);
> > + /* just in case the signal is blocked... */
> > sigaddset(&set, DNOTIFY_SIGNAL);
> > sigprocmask(SIG_UNBLOCK, &set, NULL);
> >
> > @@ -210,16 +211,13 @@ gssd_run()
> > exit(1);
> > }
> > }
> > - /* race condition here: dir_changed could be set before we
> > - * enter the poll, and we'd never notice if it weren't for the
> > - * timeout. */
> > - ret = poll(pollarray, pollsize, POLL_MILLISECS);
> > + ret = ppoll(pollarray, pollsize, NULL, &emptyset);
> > if (ret < 0) {
> > if (errno != EINTR)
> > printerr(0,
> > "WARNING: error return from poll\n");
> > } else if (ret == 0) {
> > - /* timeout */
> > + printerr(0, "WARNING: unexpected timeout\n");
> > } else { /* ret > 0 */
> > scan_poll_results(ret);
> > }
> > --
> > 1.7.9.5
> >
> > --
> > 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
> chuck[dot]lever[at]oracle[dot]com
>
>
>
next prev parent reply other threads:[~2012-07-31 22:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 21:02 [PATCH] rpc.gssd: don't call poll() twice a second J. Bruce Fields
2012-07-27 23:08 ` Jim Rees
2012-07-29 17:48 ` J. Bruce Fields
2012-07-29 23:09 ` Steve Dickson
2012-07-30 20:59 ` J. Bruce Fields
2012-07-30 22:10 ` J. Bruce Fields
2012-07-31 16:50 ` Steve Dickson
2012-07-31 20:59 ` J. Bruce Fields
2012-07-31 21:00 ` [PATCH 1/4] rpc.gssd: simplify signal handling J. Bruce Fields
2012-08-06 14:22 ` Steve Dickson
2012-07-31 21:00 ` [PATCH 2/4] rpc.gssd: don't call printerr from signal handler J. Bruce Fields
2012-07-31 21:22 ` Chuck Lever
2012-08-06 14:22 ` Steve Dickson
2012-07-31 21:00 ` [PATCH 3/4] rpc.gssd: handle error to open toplevel directory J. Bruce Fields
2012-08-06 14:23 ` Steve Dickson
2012-07-31 21:00 ` [PATCH 4/4] rpc.gssd: don't call poll() twice a second J. Bruce Fields
2012-07-31 21:23 ` Chuck Lever
2012-07-31 21:27 ` J. Bruce Fields [this message]
2012-07-31 22:29 ` Chuck Lever
2012-08-01 12:35 ` 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=20120731212744.GC1826@pad.fieldses.org \
--to=bfields@redhat.com \
--cc=SteveD@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=rees@umich.edu \
/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.