From patchwork Thu Feb 13 16:22:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Canet?= X-Patchwork-Id: 320118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 326F12C00BD for ; Fri, 14 Feb 2014 03:23:22 +1100 (EST) Received: from localhost ([::1]:47408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz4J-0000W7-Pg for incoming@patchwork.ozlabs.org; Thu, 13 Feb 2014 11:23:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz3q-0000ME-GH for qemu-devel@nongnu.org; Thu, 13 Feb 2014 11:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDz3c-0000tq-O6 for qemu-devel@nongnu.org; Thu, 13 Feb 2014 11:22:50 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:49941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDz3c-0000tD-Ej for qemu-devel@nongnu.org; Thu, 13 Feb 2014 11:22:36 -0500 Received: from localhost.localdomain (laure.irqsave.net [192.168.77.2]) by paradis.irqsave.net (Postfix) with ESMTP id 67F07626AF; Thu, 13 Feb 2014 18:00:49 +0100 (CET) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= To: qemu-devel@nongnu.org Date: Thu, 13 Feb 2014 17:22:33 +0100 Message-Id: <1392308553-9886-2-git-send-email-benoit.canet@irqsave.net> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392308553-9886-1-git-send-email-benoit.canet@irqsave.net> References: <1392308553-9886-1-git-send-email-benoit.canet@irqsave.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 62.212.105.220 Cc: kwolf@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , Benoit Canet Subject: [Qemu-devel] [PATCH] blockdev: Fix wrong usage of QDECREF causing snapshoted quorum to crash on close. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As bdrv_open() documentation states: "The reference to the QDict belongs to the block layer * after the call (even on failure), so if the caller intends to reuse the * dictionary, it needs to use QINCREF() before calling bdrv_open." the optional options dict will not be reused after bdrv_open() and should belong to the block layer so remove the extra QDECREF(options). Signed-off-by: Benoit Canet Reviewed-by: Kevin Wolf --- blockdev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 5cd50f3..7fbce6c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1316,8 +1316,6 @@ static void external_snapshot_prepare(BlkTransactionState *common, if (ret != 0) { error_propagate(errp, local_err); } - - QDECREF(options); } static void external_snapshot_commit(BlkTransactionState *common)