RE: [PATCH 1/3] Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Vitaly Kuznetsov [mailto:vkuznets@xxxxxxxxxx]
> ...
> >> @@ -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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux