ia64/linux-2.6.18-xen.hg

changeset 582:b29a06ba7a5f

blktap: bugfix and support extended device numbers

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@redhat.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 27 16:07:56 2008 +0100 (2008-06-27)
parents 65faf5fc61a1
children 3643a33de277
files drivers/xen/blktap/blktap.c
line diff
     1.1 --- a/drivers/xen/blktap/blktap.c	Fri Jun 27 16:06:41 2008 +0100
     1.2 +++ b/drivers/xen/blktap/blktap.c	Fri Jun 27 16:07:56 2008 +0100
     1.3 @@ -89,7 +89,7 @@ static int mmap_pages = MMAP_PAGES;
     1.4  /*Data struct handed back to userspace for tapdisk device to VBD mapping*/
     1.5  typedef struct domid_translate {
     1.6  	unsigned short domid;
     1.7 -	unsigned short busid;
     1.8 +	u32 busid;
     1.9  } domid_translate_t ;
    1.10  
    1.11  /*Data struct associated with each of the tapdisk devices*/
    1.12 @@ -508,6 +508,13 @@ void signal_tapdisk(int idx)
    1.13  	tap_blkif_t *info;
    1.14  	struct task_struct *ptask;
    1.15  
    1.16 +	/*
    1.17 +	 * if the userland tools set things up wrong, this could be negative;
    1.18 +	 * just don't try to signal in this case
    1.19 +	 */
    1.20 +	if (idx < 0)
    1.21 +		return;
    1.22 +
    1.23  	info = tapfds[idx];
    1.24  	if ((idx < 0) || (idx > MAX_TAP_DEV) || !info)
    1.25  		return;