All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
	ronnie sahlberg <ronniesahlberg@gmail.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-stable] Recent patches for 2.4
Date: Thu, 06 Aug 2015 09:51:21 +0200	[thread overview]
Message-ID: <55C311F9.7040800@kamp.de> (raw)
In-Reply-To: <55C1CBDA.6050803@redhat.com>

Am 05.08.2015 um 10:39 schrieb Paolo Bonzini:
>
> 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.

I also went on reproducing and can confirm, that I see FIONREAD return
0 bytes available when booting a CDROM in Qemu with libnfs before commit
cf420d3 (socket: use FIONREAD ioctl only for UDP). But a lot has changed
in rpc_read_from_socket in libnfs since we dropped FIONREAD. Most importantly
we changed from recv without flags to recv with MSG_DONTWAIT. And with
current master I never receive spurious readiness any more. So there is
nothing we need to fix here except from handling recv return 0 bytes and
then reconnect. This fix is already in the current master of libnfs. And this
solves the deadlock in qemu-img I have observed.

Thanks for you help,
Peter

  reply	other threads:[~2015-08-06  7:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  8:12 [Qemu-devel] Recent patches for 2.4 Peter Lieven
2015-07-31  8:22 ` Paolo Bonzini
2015-07-31  8:35   ` Peter Lieven
2015-07-31  9:29     ` Paolo Bonzini
2015-08-04  9:22       ` [Qemu-devel] [Qemu-stable] " Peter Lieven
2015-08-04 11:53         ` Paolo Bonzini
2015-08-04 11:57           ` Peter Lieven
2015-08-04 12:09             ` Paolo Bonzini
2015-08-04 12:29               ` Peter Lieven
2015-08-04 12:53                 ` Peter Lieven
2015-08-04 23:23                   ` ronnie sahlberg
2015-08-05  8:39                     ` Paolo Bonzini
2015-08-06  7:51                       ` Peter Lieven [this message]
2015-09-03 13:11       ` Peter Lieven
2015-09-07 16:28         ` Paolo Bonzini
2015-09-07 19:11           ` Peter Lieven
2015-09-07 19:14             ` Paolo Bonzini
2015-09-07 21:05               ` Peter Lieven
2015-09-21  7:40               ` Peter Lieven
2015-09-21  9:41                 ` Paolo Bonzini
2015-09-21  9:52                   ` Peter Lieven
2015-09-21 12:16                     ` Paolo Bonzini
2015-08-04 18:20     ` Michael Roth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55C311F9.7040800@kamp.de \
    --to=pl@kamp.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.