From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: xen-devel@lists.xensource.com, Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] xen/blkfront: allow xenbus state transition to Closing->Closed when not Connected.
Date: Mon, 18 May 2009 10:23:01 -0700 [thread overview]
Message-ID: <4A119975.4000501@goop.org> (raw)
In-Reply-To: <1242650974-13056-2-git-send-email-ian.campbell@citrix.com>
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@citrix.com>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>
Jens, does this look OK to you?
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Thanks,
J
> ---
> 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");
>
next prev parent reply other threads:[~2009-05-18 17:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-18 12:48 [GIT] blkfront warning and crash fixes Ian Campbell
2009-05-18 12:49 ` [PATCH] xen/blkfront: fix warning when deleting gendisk on unplug/shutdown Ian Campbell
2009-05-18 19:11 ` Jeremy Fitzhardinge
2009-05-19 6:28 ` Jens Axboe
2009-05-18 12:49 ` [PATCH] xen/blkfront: allow xenbus state transition to Closing->Closed when not Connected Ian Campbell
2009-05-18 17:23 ` Jeremy Fitzhardinge [this message]
2009-05-18 18:34 ` Jens Axboe
2009-05-18 18:41 ` Jeremy Fitzhardinge
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=4A119975.4000501@goop.org \
--to=jeremy@goop.org \
--cc=ian.campbell@citrix.com \
--cc=jens.axboe@oracle.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.