WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] xen/blkfront: allow xenbus state transition to C

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] xen/blkfront: allow xenbus state transition to Closing->Closed when not Connected.
From: Jens Axboe <jens.axboe@xxxxxxxxxx>
Date: Mon, 18 May 2009 20:34:21 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 19 May 2009 14:28:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A119975.4000501@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1242650931.20731.41.camel@xxxxxxxxxxxxxxxxxxxxxx> <1242650974-13056-2-git-send-email-ian.campbell@xxxxxxxxxx> <4A119975.4000501@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, May 18 2009, Jeremy Fitzhardinge wrote:
> Ian Campbell wrote:
>> This situation can occur when attempting to attach a block device whose 
>> backend
>> is an empty physical CD-ROM driver. The backend in this case will go directly
>> from the Initialising state to Closing->Closed. Previously this would result 
>> in
>> a NULL pointer deref on info->gd (xenbus_dev_fatal does not return as 
>> a1a15ac5
>> seems to expect)
>>
>> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
>> Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
>>   
>
> Jens, does this look OK to you?
>
> Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>

Looks fine, shall I add it for 2.6.30? Does it need a stable backport?

>>  drivers/block/xen-blkfront.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
>> index aa0c94b..a6cbf7b 100644
>> --- a/drivers/block/xen-blkfront.c
>> +++ b/drivers/block/xen-blkfront.c
>> @@ -977,8 +977,10 @@ static void backend_changed(struct xenbus_device *dev,
>>              break;
>>      case XenbusStateClosing:
>> -            if (info->gd == NULL)
>> -                    xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
>> +            if (info->gd == NULL) {
>> +                    xenbus_frontend_closed(dev);
>> +                    break;
>> +            }
>>              bd = bdget_disk(info->gd, 0);
>>              if (bd == NULL)
>>                      xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
>>   
>

-- 
Jens Axboe


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