Horms
2005-Dec-26 08:55 UTC
[Xen-devel] [PATCH] Prevent vbd frontend from oopsing if the underlying device doesn''t exist
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); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2005-Dec-27 15:31 UTC
Re: [Xen-devel] [PATCH] Prevent vbd frontend from oopsing if the underlying device doesn''t exist
On Mon, Dec 26, 2005 at 08:55:45AM +0000, Horms wrote:> 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.Thanks, applied. -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel