All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Florath <xen@flonatel.org>
To: xen-devel@lists.xensource.com
Subject: Error handling in xen-blkfront.c
Date: Wed, 29 Jul 2009 21:57:06 +0200	[thread overview]
Message-ID: <4A70A992.5030804@flonatel.org> (raw)

Hello!

Just analyzed the kernel Oops reported in [1] issue 3).

Stumbled over the following lines:
(linux-2.6-pvops.git/drivers/block/xen-blkfront.c line 979ff)

<code>
	case XenbusStateClosing:
		if (info->gd == NULL)
			xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
		bd = bdget_disk(info->gd, 0);
</code>

The error message is:

[   79.768028] vbd vbd-51713: 19 gd is NULL
[   79.772149] BUG: unable to handle kernel NULL pointer dereference at 0000002c
[   79.772204] IP: [] disk_get_part+0x8/0x2d
... Kernel Oops stack trace follows ...
[   79.772940] Call Trace:
[   79.772960]  [] ? bdget_disk+0xc/0x2d
...

There is checked, if the info->gd is null.  If so, some error handling
is done and IMHO then 'xenbus_dev_fatal()' returns and
'bdget_disk()' is called.  I think there should be something like a
'return;' or a 'goto out;' in between - maybe with some error handling.

Adding a 'return;' (because I think when info->gd is NULL there is
nothing more to do):

<code>
	case XenbusStateClosing:
		if (info->gd == NULL) {
			xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
			return;
		}
		bd = bdget_disk(info->gd, 0);
</code>

Results in the error message:

[   46.378565] vbd vbd-51713: 19 gd is NULL
[   46.409129] vbd vbd-51713: 19 gd is NULL

without any stack trace.

Ok, I know: this does not fix the problem, only the error handling.

AFAIK the xen-blkfront.c is not part of xen-unstable.  What to do with
this?   Where to report?  (Keir maybe you know - your one of the
authors of xen-blkfront.c ;-) )

Kind regards

Andreas


[1] http://lists.xensource.com/archives/html/xen-devel/2009-07/msg01265.html

                 reply	other threads:[~2009-07-29 19:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4A70A992.5030804@flonatel.org \
    --to=xen@flonatel.org \
    --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.