[ovs-dev] [PATCH] poll-loop: fix assertion in poll_create_node

Ben Pfaff blp at nicira.com
Wed Sep 30 15:39:56 UTC 2015


Please don't drop the list.

On Wed, Sep 30, 2015 at 06:13:19PM +0300, Ilya Maximets wrote:
> On 30.09.2015 01:25, Ben Pfaff wrote:
> > Do we additionally need this?
> > 
> > diff --git a/lib/poll-loop.c b/lib/poll-loop.c
> > index 36eb5ac..28e98ad 100644
> > --- a/lib/poll-loop.c
> > +++ b/lib/poll-loop.c
> > @@ -297,7 +297,7 @@ free_poll_nodes(struct poll_loop *loop)
> >      HMAP_FOR_EACH_SAFE (node, next, hmap_node, &loop->poll_nodes) {
> >          hmap_remove(&loop->poll_nodes, &node->hmap_node);
> >  #ifdef _WIN32
> > -        if (node->wevent && node->pollfd.fd) {
> > +        if (node->wevent && node->pollfd.fd >= 0) {
> >              WSAEventSelect(node->pollfd.fd, NULL, 0);
> >              CloseHandle(node->wevent);
> >          }
> > @@ -341,7 +341,7 @@ poll_block(void)
> >          pollfds[i] = node->pollfd;
> >  #ifdef _WIN32
> >          wevents[i] = node->wevent;
> > -        if (node->pollfd.fd && node->wevent) {
> > +        if (node->pollfd.fd >= 0 && node->wevent) {
> >              short int wsa_events = 0;
> >              if (node->pollfd.events & POLLIN) {
> >                  wsa_events |= FD_READ | FD_ACCEPT | FD_CLOSE;
> > 
> 
> Sorry, I missed this part in my patch. I think, this should be applied.

It was tested and did not fix the problem, because under Windows struct
pollfd's 'fd' member has an unsigned type.

I support reverting this patch.  It breaks a whole operating system
port.  That is much more important than avoiding a secondary problem due
to a buggy NIC driver.



More information about the dev mailing list