summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-09-16 10:53:13 +0200
committerHans de Goede <hdegoede@redhat.com>2010-09-16 10:53:13 +0200
commit606af2d7c2a1f391d8d7f6850bd6685a2a887965 (patch)
tree1362c0f38ad83243aecb000431e5ee99438efb10
parente34bb01b5f209b88f10ac44b5c8c308dc6759753 (diff)
downloadkernel-606af2d7c2a1f391d8d7f6850bd6685a2a887965.tar.gz
kernel-606af2d7c2a1f391d8d7f6850bd6685a2a887965.tar.xz
kernel-606af2d7c2a1f391d8d7f6850bd6685a2a887965.zip
- Small fix to virtio_console poll fix from upstream review
-rw-r--r--kernel.spec3
-rw-r--r--linux-2.6.35.4-virtio_console-fix-poll.patch10
2 files changed, 8 insertions, 5 deletions
diff --git a/kernel.spec b/kernel.spec
index f44f98d12..2b49341ce 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1906,6 +1906,9 @@ fi
# || ||
%changelog
+* Thu Sep 16 2010 Hans de Goede <hdegoede@redhat.com>
+- Small fix to virtio_console poll fix from upstream review
+
* Wed Sep 15 2010 Hans de Goede <hdegoede@redhat.com>
- virtio_console: Fix poll/select blocking even though there is data to read
diff --git a/linux-2.6.35.4-virtio_console-fix-poll.patch b/linux-2.6.35.4-virtio_console-fix-poll.patch
index ff46eb41e..b87bdf077 100644
--- a/linux-2.6.35.4-virtio_console-fix-poll.patch
+++ b/linux-2.6.35.4-virtio_console-fix-poll.patch
@@ -1,4 +1,4 @@
-Subject: virtio_console: Fix poll blocking even though there is data to read (version 2)
+Subject: virtio_console: Fix poll blocking even though there is data to read
From: Hans de Goede <hdegoede@redhat.com>
I found this while working on a Linux agent for spice, the symptom I was
@@ -10,9 +10,9 @@ read won't block. However if an application reads enough bytes from inbuf
through port_fops_read, to empty the current port->inbuf, port->inbuf
will be NULL even though there may be buffers left in the virtqueue.
-This causes poll() to block even though there is data ready to be read, this
-patch fixes this by using port_has_data(port) instead of the
-port->inbuf != NULL check.
+This causes poll() to block even though there is data to be read, this patch
+fixes this by using the alredy defined will_read_block utility function
+instead of the port->inbuf != NULL check.
Signed-off-By: Hans de Goede <hdegoede@redhat.com>
diff -up linux-2.6.35.x86_64/drivers/char/virtio_console.c~ linux-2.6.35.x86_64/drivers/char/virtio_console.c
@@ -23,7 +23,7 @@ diff -up linux-2.6.35.x86_64/drivers/char/virtio_console.c~ linux-2.6.35.x86_64/
ret = 0;
- if (port->inbuf)
-+ if (port_has_data(port))
++ if (!will_read_block(port))
ret |= POLLIN | POLLRDNORM;
if (!will_write_block(port))
ret |= POLLOUT;