[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c8623a7ab554bf4b426b8eedd9e2c21@HKXPR3004MB0088.064d.mgd.msft.net>
Date: Wed, 16 Dec 2015 10:41:24 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
CC: KY Srinivasan <kys@...rosoft.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"apw@...onical.com" <apw@...onical.com>,
"jasowang@...hat.com" <jasowang@...hat.com>
Subject: RE: [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on
transport destroy
> From: Vitaly Kuznetsov [mailto:vkuznets@...hat.com]
> ...
> >> @@ -109,7 +109,7 @@ static unsigned int hvt_op_poll(struct file *file,
> >> poll_table *wait)
> >> poll_wait(file, &hvt->outmsg_q, wait);
> >>
> >> if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
> >> - return -EBADF;
> >> + return POLLERR | POLLHUP;
> >>
> >> if (hvt->outmsg_len > 0)
> >> return POLLIN | POLLRDNORM;
> >> --
> >
> > Hi Vitaly,
> > The daemon only polls on POLLIN.
> > I'm not sure returning "POLLERR | POLLHUP" here can wake up the daemon or
> not.
> >
>
> I tested this patch with hv_kvp_daemon which does poll() and it
> works: we wake up all pollers from hvutil_transport_destroy(). Here
> we just need to return proper value. Actually, the return value doesn't
> really matter -- we do read() after poll() and get -EBADF there. But
> let's be consistent.
>
> Vitaly
Thanks Vitaly for the explanation!
I checked do_pollfd() and can confirm it's OK.
Thanks,
-- Dexuan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists