Prevent vbd frontend from oopsing if the underlying device doesn't exist
PATCH 1/1 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 <[email protected]>
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +6 -1
@@ -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);
Vincent Hanquez
AppliedQuoted 6 lines · Horms
Prevent vbd frontend from oopsing if the underlying device doesn't exist.
connect()inblkfront.cwas not checking the return value ofxlvbd_add(). In my casexlvbd_alloc_gendisk()was failing inxlvbd_add(), and the subsequent call tokick_pending_request_queues()barfed becauseinfo->rqwas unitinialised.
Thanks, applied.
Signature · 1 line
Vincent Hanquez