WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH UPDATED] xen/xenfs: fix xenbus message reads

To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH UPDATED] xen/xenfs: fix xenbus message reads
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 17 Dec 2008 13:40:06 -0800
Cc: alex.zeffertt@xxxxxxxxxxxxx, Ian.Campbell@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, viro@xxxxxxxxxxxxxxxx, mingo@xxxxxxx
Delivery-date: Wed, 17 Dec 2008 13:40:55 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49496E17.2010703@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <49480F39.2010102@xxxxxxxx> <20081216125425.30524946.akpm@xxxxxxxxxxxxxxxxxxxx> <49496E17.2010703@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (X11/20081119)
Compute the remaining data size properly.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
drivers/xen/xenfs/xenbus.c |    2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

===================================================================
--- a/drivers/xen/xenfs/xenbus.c
+++ b/drivers/xen/xenfs/xenbus.c
@@ -132,7 +132,7 @@
        rb = list_entry(u->read_buffers.next, struct read_buffer, list);
        i = 0;
        while (i < len) {
-               unsigned sz = min((unsigned)len - i, rb->cons - rb->len);
+               unsigned sz = min((unsigned)len - i, rb->len - rb->cons);

                ret = copy_to_user(ubuf + i, &rb->msg[rb->cons], sz);




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel