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] [PATCH 2/5]: Blktap backend fixes

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/5]: Blktap backend fixes
From: Chris Lalancette <clalance@xxxxxxxxxx>
Date: Mon, 23 Jun 2008 20:26:36 +0200
Delivery-date: Mon, 23 Jun 2008 11:28:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
This simple patch puts two fixes into the blktap backend.  The first is a change
of busid from an unsigned short to a u32 so we can accommodate the new expanded
format (which doesn't fit into 16-bits).  The second is a minor fix to
signal_tapdisk(); while developing, if the tools happen to set up the tapfds
wrong, you can get into a situation where the idx passed to signal_tapdisk() is
NULL, causing a kernel OOPS.  The fix for signal_tapdisk() just returns if the
idx is negative, preventing the crash.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
diff -r 5201a184f513 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c       Fri Jun 20 17:43:16 2008 +0100
+++ b/drivers/xen/blktap/blktap.c       Mon Jun 23 17:50:28 2008 +0200
@@ -89,7 +89,7 @@ static int mmap_pages = MMAP_PAGES;
 /*Data struct handed back to userspace for tapdisk device to VBD mapping*/
 typedef struct domid_translate {
        unsigned short domid;
-       unsigned short busid;
+       u32 busid;
 } domid_translate_t ;
 
 /*Data struct associated with each of the tapdisk devices*/
@@ -507,6 +507,13 @@ void signal_tapdisk(int idx)
 {
        tap_blkif_t *info;
        struct task_struct *ptask;
+
+       /*
+        * if the userland tools set things up wrong, this could be negative;
+        * just don't try to signal in this case
+        */
+       if (idx < 0)
+               return;
 
        info = tapfds[idx];
        if ((idx < 0) || (idx > MAX_TAP_DEV) || !info)
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/5]: Blktap backend fixes, Chris Lalancette <=