[kernel/f14/master] - Small fix to virtio_console poll fix from upstream review
Hans de Goede
jwrdegoede at fedoraproject.org
Thu Sep 16 08:53:51 UTC 2010
commit 7193965656df963dd0cec2cb20bbe4131b8fce90
Author: Hans de Goede <hdegoede at redhat.com>
Date: Thu Sep 16 10:53:51 2010 +0200
- Small fix to virtio_console poll fix from upstream review
kernel.spec | 3 +++
linux-2.6.35.4-virtio_console-fix-poll.patch | 10 +++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index d29ba1f..199b2d8 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -1974,6 +1974,9 @@ fi
# and build.
%changelog
+* Thu Sep 16 2010 Hans de Goede <hdegoede at redhat.com>
+- Small fix to virtio_console poll fix from upstream review
+
* Wed Sep 15 2010 Dave Jones <davej at redhat.com>
- Fix another RCU lockdep warning (cgroups).
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 ff46eb4..b87bdf0 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 at 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 at 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;
More information about the scm-commits
mailing list