Re: [linux-usb-devel] Re: My vision of usbmon

Pete Zaitcev
2004-12-20T12:21:44Z

On Mon, 20 Dec 2004 12:55:59 +0100, Oliver Neukum <oliver@neukum.org> wrote:

> Am Montag, 20. Dezember 2004 08:04 schrieb Pete Zaitcev:
> > +       add_wait_queue(&rp->wait, &waita);
> > +       while ((ep = mon_text_fetch(rp, mbus)) == NULL) {
> > +               if (file->f_flags & O_NONBLOCK) {
> > +                       remove_wait_queue(&rp->wait, &waita);
> > +                       return -EWOULDBLOCK;    /* Same as EAGAIN in Linux */
> > +               }
> > +               /*
> > +                * We do not count nwaiters, because ->release is supposed
> > +                * to be called when all openers are gone only.
> > +                */
> > +               set_current_state(TASK_INTERRUPTIBLE);
>
> Here you can lose a wakeup.
>
> > +               schedule();

Thanks, Oliver. Indeed, it's a bug.

-- Pete