All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Lalancette <clalance@redhat.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH 2/4]: Blktap backend fixes
Date: Mon, 23 Jun 2008 20:28:13 +0200	[thread overview]
Message-ID: <485FEB3D.6040909@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

(please ignore my [PATCH 2/5]; this is just a resend of the same thing, with a
proper subject)

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>

[-- Attachment #2: xen-unstable-greater-16-vbd-kernel-blktap-fixes.patch --]
[-- Type: text/x-patch, Size: 820 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

                 reply	other threads:[~2008-06-23 18:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485FEB3D.6040909@redhat.com \
    --to=clalance@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.