qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Pavel Butsykin <pbutsykin@virtuozzo.com>
Subject: Re: [Qemu-devel] [PATCH for 2.6 1/1] nbd: fix assert() on qemu-nbd stop
Date: Thu, 14 Apr 2016 23:41:26 +0200	[thread overview]
Message-ID: <57100E86.2030408@redhat.com> (raw)
In-Reply-To: <1460629215-11567-1-git-send-email-den@openvz.org>


[-- Attachment #1.1: Type: text/plain, Size: 1128 bytes --]

On 14.04.2016 12:20, Denis V. Lunev wrote:
> From: Pavel Butsykin <pbutsykin@virtuozzo.com>
> 
> From time to time qemu-nbd is crashing on the following assert:
>     assert(state == TERMINATING);
>     nbd_export_closed
>     nbd_export_put
>     main
> and the state at the moment of the crash is evaluated to TERMINATE.
> 
> During shutdown process of the client the nbd_client_thread thread sends
> SIGTERM signal and the main thread calls the nbd_client_closed callback.
> If the SIGTERM callback will be executed after change the state to
> TERMINATING, then the state will once again be TERMINATE.
> 
> To solve the issue, we must change the state to TERMINATE only if the state
> is RUNNING. In the other case we are shutting down already.
> 
> Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  qemu-nbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks Pavel and Denis, I have applied the patch to my block tree:

https://github.com/XanClic/qemu/commits/block

Max


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

      parent reply	other threads:[~2016-04-14 21:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 10:20 [Qemu-devel] [PATCH for 2.6 1/1] nbd: fix assert() on qemu-nbd stop Denis V. Lunev
2016-04-14 13:23 ` Paolo Bonzini
2016-04-14 13:40   ` Denis V. Lunev
2016-04-14 14:16     ` Paolo Bonzini
2016-04-14 21:41 ` Max Reitz [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=57100E86.2030408@redhat.com \
    --to=mreitz@redhat.com \
    --cc=den@openvz.org \
    --cc=pbonzini@redhat.com \
    --cc=pbutsykin@virtuozzo.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).