From patchwork Tue May 4 12:20:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 51601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5862AB7D28 for ; Tue, 4 May 2010 22:40:26 +1000 (EST) Received: from localhost ([127.0.0.1]:53664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9HN0-00024F-Fp for incoming@patchwork.ozlabs.org; Tue, 04 May 2010 08:37:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9H7x-0005S2-Kf for qemu-devel@nongnu.org; Tue, 04 May 2010 08:21:29 -0400 Received: from [140.186.70.92] (port=50594 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9H7s-0005Q4-Vh for qemu-devel@nongnu.org; Tue, 04 May 2010 08:21:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9H7r-0000AJ-5u for qemu-devel@nongnu.org; Tue, 04 May 2010 08:21:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58537) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9H7q-0000A3-QG for qemu-devel@nongnu.org; Tue, 04 May 2010 08:21:23 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o44CLDlK006376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 May 2010 08:21:13 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-217.str.redhat.com [10.32.5.217]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o44CLAIH030750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 May 2010 08:21:12 -0400 Message-ID: <4BE01120.30608@redhat.com> Date: Tue, 04 May 2010 14:20:48 +0200 From: Kevin Wolf User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4 MIME-Version: 1.0 To: Peter Lieven Subject: Re: [Qemu-devel] Qemu-KVM 0.12.3 and Multipath -> Assertion References: <4BDF3F94.1080608@dlh.net> <4BDFDC44.9030808@redhat.com> <4BE00750.6040804@dlh.net> In-Reply-To: <4BE00750.6040804@dlh.net> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Christoph Hellwig X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 04.05.2010 13:38, schrieb Peter Lieven: > hi kevin, > > i set a breakpint at bmdma_active_if. the first 2 breaks encountered > when the last path in the multipath > failed, but the assertion was not true. > when i kicked one path back in the breakpoint was reached again, this > time leading to an assert. > the stacktrace is from the point shortly before. > > hope this helps. Hm, looks like there's something wrong with cancelling requests - bdrv_aio_cancel might decide that it completes a request (and consequently calls the callback for it) whereas the IDE emulation decides that it's done with the request before calling bdrv_aio_cancel. I haven't looked in much detail what this could break, but does something like this help? Kevin Reviewed-by: Christoph Hellwig diff --git a/hw/ide/core.c b/hw/ide/core.c index 0757528..3cd55e3 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2838,10 +2838,6 @@ static void ide_dma_restart(IDEState *s, int is_read) void ide_dma_cancel(BMDMAState *bm) { if (bm->status & BM_STATUS_DMAING) { - bm->status &= ~BM_STATUS_DMAING; - /* cancel DMA request */ - bm->unit = -1; - bm->dma_cb = NULL; if (bm->aiocb) { #ifdef DEBUG_AIO printf("aio_cancel\n"); @@ -2849,6 +2845,10 @@ void ide_dma_cancel(BMDMAState *bm) bdrv_aio_cancel(bm->aiocb); bm->aiocb = NULL; } + bm->status &= ~BM_STATUS_DMAING; + /* cancel DMA request */ + bm->unit = -1; + bm->dma_cb = NULL; } }