qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Kashyap Chamarthy <kchamart@redhat.com>
Subject: Re: [Qemu-devel] QEMU segfault: Booting an overlay with backing_file over NBD: nbd.c:nbd_receive_request():L756: read failed
Date: Mon, 2 Feb 2015 09:14:34 +0100	[thread overview]
Message-ID: <20150202081434.GF4258@stefanha-thinkpad.fosdem.net> (raw)
In-Reply-To: <54CBDC49.6040305@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]

On Fri, Jan 30, 2015 at 02:32:25PM -0500, Max Reitz wrote:
> Kevin, Stefan: The real problem is that block/nbd.c stores a BDRVNBDState
> object in bs->opaque and passes &BDRVNBDState.client (an NbdClientSession
> object) to the block/nbd-client.c functions. Those functions then receive
> the BDS pointer from client->bs. If an NBD BDS is a root BDS (as in this
> case), at some point a bdrv_swap() may happen (and it does happen here)
> which leads to ((BDRVNBDState *)bs->opaque)->client.bs != bs, and that's
> where the segfault comes from (bdrv_get_aio_context() returns NULL).
> 
> One way to fix this real problem is to remove the BDS pointer from the
> NbdClientSession and to always pass the BDS explicitly to the
> block/nbd-client.c functions; the other is to always update the BDS pointer
> in NbdClientSession in block/nbd.c. I'll try the former, and if it doesn't
> work, will do the latter (if you don't object).

Sounds good.

On a related note I asked John Snow to look at QED and vvfat's
.bdrv_rebind() usage.  I think we can get rid of that API after
propagating BlockDriverState *bs arguments to QED and vvfat functions.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

      parent reply	other threads:[~2015-02-02  8:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 16:25 [Qemu-devel] QEMU segfault: Booting an overlay with backing_file over NBD: nbd.c:nbd_receive_request():L756: read failed Kashyap Chamarthy
2015-01-29 16:47 ` Richard W.M. Jones
2015-01-29 17:22   ` Kashyap Chamarthy
2015-01-29 23:33     ` Kashyap Chamarthy
2015-01-30 17:15 ` Kevin Wolf
2015-01-30 18:41   ` Kashyap Chamarthy
2015-01-30 19:32     ` Max Reitz
2015-01-30 22:13       ` Kashyap Chamarthy
2015-02-02  8:14       ` Stefan Hajnoczi [this message]

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=20150202081434.GF4258@stefanha-thinkpad.fosdem.net \
    --to=stefanha@redhat.com \
    --cc=kchamart@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).