RE: [PATCH 3/9] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

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

 



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf
> Of K. Y. Srinivasan
> Sent: Tuesday, December 15, 2015 11:02
> To: gregkh@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> devel@xxxxxxxxxxxxxxxxxxxxxx; olaf@xxxxxxxxx; apw@xxxxxxxxxxxxx;
> vkuznets@xxxxxxxxxx; jasowang@xxxxxxxxxx
> Subject: [PATCH 3/9] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY
> mode
> 
> From: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
> 
> When Hyper-V host asks us to remove some util driver by closing the
> appropriate channel there is no easy way to force the current file
> descriptor holder to hang up but we can start to respond -EBADF to all
> operations asking it to exit gracefully.
> 
> As we're setting hvt->mode from two separate contexts now we need to use
> a proper locking.
> 
> ...
> @@ -99,6 +107,10 @@ static unsigned int hvt_op_poll(struct file *file,
> poll_table *wait)
>  	hvt = container_of(file->f_op, struct hvutil_transport, fops);
> 
>  	poll_wait(file, &hvt->outmsg_q, wait);
> +
> +	if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
> +		return -EBADF;
> +
>  	if (hvt->outmsg_len > 0)
>  		return POLLIN | POLLRDNORM;

Hi Vitaly, 
Should hvt_op_poll() return -EBADF -- I think it probably
should return POLLERR or POLLHUP?

-- 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