qemu-stable
[Top][All Lists]
Advanced

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

Re: [Qemu-stable] Recent patches for 2.4


From: Paolo Bonzini
Subject: Re: [Qemu-stable] Recent patches for 2.4
Date: Wed, 5 Aug 2015 10:39:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0


On 05/08/2015 01:23, ronnie sahlberg wrote:
> 
> You only get >0 from this call if there are actual bytes available to read.
> 
> For context,  the problem was that
> 
> 
>   75 static void nfs_process_read(void *arg)
>   76 {
>   77     NFSClient *client = arg;
>   78     nfs_service(client->context, POLLIN);
>   79     nfs_set_events(client);
>   80 }
> 
> sometimes trigger and call nfs_service(POLLIN) eventhough the socket is
> not readable.

Does read() return -1/EAGAIN or 0?

If it returns 0, then this is expected: it means that the other side has
shutdown the socket's write-side.  libnfs should either reconnect, or
disable POLLIN, treat all pending operations as aborted and stop
submitting more.

Paolo

> I verified this by adding an extra call to poll() at around line 78
> to check whether POLLIN was actually set on the fd or not. Sometimes it
> would not be but I got lost in the sources and could not find if or
> where this happens or even if qemu even guarantees "only call the POLLIN
> callbacks if the filedescriptor is actually readable".
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]