|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libvchan: Make raw_get_{data_ready, buffer_space} match
commit 821096dd8acc4b5ba32f942e3daf9ff2b928ce09
Author: Jason Andryuk <andryuk@xxxxxxxx>
AuthorDate: Fri May 16 16:48:16 2014 -0400
Commit: Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Mon Jun 2 14:36:05 2014 +0100
libvchan: Make raw_get_{data_ready, buffer_space} match
For writing into a vchan, raw_get_buffer_space used >, allowing the full
ring size to be written. On the read side, raw_get_data_ready compared
the ring size with >=. This mismatch means a completely filled buffer
cannot be read. Fix this by making the size checks identical.
Signed-off-by: Jason Andryuk <andryuk@xxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
tools/libvchan/io.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 804c63c..6e6e239 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -118,7 +118,7 @@ static inline int send_notify(struct libxenvchan *ctrl,
uint8_t bit)
static inline int raw_get_data_ready(struct libxenvchan *ctrl)
{
uint32_t ready = rd_prod(ctrl) - rd_cons(ctrl);
- if (ready >= rd_ring_size(ctrl))
+ if (ready > rd_ring_size(ctrl))
/* We have no way to return errors. Locking up the ring is
* better than the alternatives. */
return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |