All of lore.kernel.org
 help / color / mirror / Atom feed
From: Horms <horms@verge.net.au>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Prevent vbd frontend from oopsing if the underlying device doesn't exist
Date: Mon, 26 Dec 2005 08:55:45 +0000 (UTC)	[thread overview]
Message-ID: <doob6g$p6b$1@sea.gmane.org> (raw)

Prevent vbd frontend from oopsing if the underlying device doesn't exist.

connect() in blkfront.c was not checking the return value of xlvbd_add().
In my case xlvbd_alloc_gendisk() was failing in xlvbd_add(), and the
subsequent call to kick_pending_request_queues() barfed because info->rq
was unitinialised.

Signed-Off-By: Horms <horms@verge.net.au>

diff -r e3b95be182e2 -r 9c36c9568da0 linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Thu Dec 22 03:30:14 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Dec 26 08:52:20 2005
@@ -338,7 +338,12 @@
 		return;
 	}
 
-        xlvbd_add(sectors, info->vdevice, binfo, sector_size, info);
+        err = xlvbd_add(sectors, info->vdevice, binfo, sector_size, info);
+	if (err) {
+		xenbus_dev_fatal(info->xbdev, err, "xlvbd_add at %s",
+				 info->xbdev->otherend);
+		return;
+	}
 
 	(void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); 

             reply	other threads:[~2005-12-26  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-26  8:55 Horms [this message]
2005-12-27 15:31 ` [PATCH] Prevent vbd frontend from oopsing if the underlying device doesn't exist Vincent Hanquez

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='doob6g$p6b$1@sea.gmane.org' \
    --to=horms@verge.net.au \
    --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.