From: "Ross Maxfield" <rmaxfiel@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] opps in blockback when missing media
Date: Mon, 15 May 2006 12:14:35 -0600 [thread overview]
Message-ID: <44686ECF.DD28.00D3.0@novell.com> (raw)
In-Reply-To: <4468C0AF.5010006@virtualiron.com>
[-- Attachment #1: Type: text/plain, Size: 1690 bytes --]
Hello,
I've created a patch to prevent an oops in Dom0 that occurs when a CD
device, specified as one of the 'hardrives' in the 'disk=' line of a
para-virtualized guest's def file, has no media when the guest is
started.
The oops occurs in vbd.c when vbd_size() is called from connect() (in
xenbus.c) and the vbd pointer is really an error code that comes from
the failed open that occurred in vbd_create().
This patch applies to changeset 9993
signed off by Ross Maxfield <rmaxfiel@novell.com>
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c Mon May 15
16:32:09 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c Mon May 15
11:49:39 2006 -0600
@@ -66,9 +66,10 @@ int vbd_create(blkif_t *blkif, blkif_vde
vbd->bdev = open_by_devnum(
vbd->pdevice,
vbd->readonly ? FMODE_READ : FMODE_WRITE);
+
if (IS_ERR(vbd->bdev)) {
- DPRINTK("vbd_creat: device %08x doesn't exist.\n",
- vbd->pdevice);
+ DPRINTK("vbd_creat: device %08x could not be
opened.\n",
+ vbd->bdev = NULL;
return -ENOENT;
}
diff -r dc213d745642 linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon May 15
16:32:09 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon May 15
11:49:39 2006 -0600
@@ -305,6 +305,9 @@ static void connect(struct backend_info
DPRINTK("%s", dev->otherend);
+ if (be->blkif->vbd.bdev == NULL)
+ return;
+
/* Supply the information about the device the frontend needs
*/
again:
err = xenbus_transaction_start(&xbt);
[-- Attachment #2: blkback-missing-media.diff --]
[-- Type: application/octet-stream, Size: 1122 bytes --]
diff -r dc213d745642 linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c Mon May 15 16:32:09 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c Mon May 15 11:49:39 2006 -0600
@@ -66,9 +66,10 @@ int vbd_create(blkif_t *blkif, blkif_vde
vbd->bdev = open_by_devnum(
vbd->pdevice,
vbd->readonly ? FMODE_READ : FMODE_WRITE);
+
if (IS_ERR(vbd->bdev)) {
- DPRINTK("vbd_creat: device %08x doesn't exist.\n",
- vbd->pdevice);
+ DPRINTK("vbd_creat: device %08x could not be opened.\n",
+ vbd->bdev = NULL;
return -ENOENT;
}
diff -r dc213d745642 linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon May 15 16:32:09 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon May 15 11:49:39 2006 -0600
@@ -305,6 +305,9 @@ static void connect(struct backend_info
DPRINTK("%s", dev->otherend);
+ if (be->blkif->vbd.bdev == NULL)
+ return;
+
/* Supply the information about the device the frontend needs */
again:
err = xenbus_transaction_start(&xbt);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2006-05-15 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-15 17:55 Testing status of fully virtualized guests (Intel VT) on 64bit XEN unstable Ed Smith
2006-05-15 18:14 ` Ross Maxfield [this message]
2006-05-16 8:30 ` [PATCH] opps in blockback when missing media Keir Fraser
2006-05-26 17:28 ` [PATCH][RFC] Sharing removable media patch Ross Maxfield
2006-05-26 18:52 ` Ross Maxfield
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=44686ECF.DD28.00D3.0@novell.com \
--to=rmaxfiel@novell.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.