From nobody Sat May 18 17:34:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1554910000; cv=none; d=zoho.com; s=zohoarc; b=KIqyx/ilQcmCrSp61UYCRgca9gEsw7tC3YbfpRdiVCP9S3tMkIZYLD/VkNZbicMGXGES6atZfFwdEto1bxxTCJiMUsqxvoEM2sAEgtygpDE11nDdisye+tEmarEi+DFR4A+D8QdaI+8wCpKAXQ7vvvo+FFWc3fj+andptxWwRcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554910000; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=NiiZmZYoiKLqKCOmTx7ABlStDDvDLIoMY/T9jpTUQNI=; b=nvKSmz0unDRD9jmoijjs31ec8WyQ1tKsuuvNcROPS3dRWQpHZUS7Bn9tykvrHO20KKWJ3RMmz6PT+CAYXKeF8aj53fT5RT+J94iCoxvYVbxn/ZzOlOYRb2ytTg69Ts7eWwixm3ExavyUgzuKMwOOWvqTqybx0g5Gwijt7/TyjnY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=null header.from= header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 155490999844481.6571047974561; Wed, 10 Apr 2019 08:26:38 -0700 (PDT) Received: from localhost ([127.0.0.1]:33257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEF7N-0002sE-9N for importer@patchew.org; Wed, 10 Apr 2019 11:26:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEF67-0001n5-MN for qemu-devel@nongnu.org; Wed, 10 Apr 2019 11:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEF66-0003rk-PC for qemu-devel@nongnu.org; Wed, 10 Apr 2019 11:25:11 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:40401) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEF66-0003fP-3v; Wed, 10 Apr 2019 11:25:10 -0400 Received: from 178-55-128-240.bb.dnainternet.fi ([178.55.128.240] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1hEF5l-0001la-OW; Wed, 10 Apr 2019 17:24:49 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1hEF5W-00026z-G3; Wed, 10 Apr 2019 18:24:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:Cc:To:From; bh=NiiZmZYoiKLqKCOmTx7ABlStDDvDLIoMY/T9jpTUQNI=; b=MtXVCco4y7+4K8ToetNE6fSR/isNMiLbxQKFfcF/ysMWl5gAxiTDHszmNXAlXfmb7AdB+Zu5rq4cMyaS2rHZJF71KUBPrZf4X3bz9z1/9PIpTRAMq8XukxztMDI3WtyE1LgQdUVHMmqgAlzR8aOjT9DwlYl75SJ7TueumQ5Jkpe88KNwM1rtHAHN2cbzEM6H12kioqINHIhQogdMdMxwma3TSeJJni98XAeyPuE0m2uW0kAqAl/aVmkHtetuX8TB97UwTgGRzbvOBq2oYbUaF5b1UYobps0JwDldXRXSzhvSFz3OpdfyZ6iw7nZI9ElY2gfAV5fDEQDPm+3W89jueg==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 10 Apr 2019 18:24:29 +0300 Message-Id: <20190410152429.8076-1-berto@igalia.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH for-4.1] commit: Make base read-only if there is an early failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" You can reproduce this by passing an invalid filter-node-name (like "1234") to block-commit. In this case the base image is put in read-write mode but is never reset back to read-only. Signed-off-by: Alberto Garcia --- block/commit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/commit.c b/block/commit.c index ba60fef58a..698eda1dfe 100644 --- a/block/commit.c +++ b/block/commit.c @@ -384,6 +384,9 @@ fail: if (s->top) { blk_unref(s->top); } + if (s->base_read_only) { + bdrv_reopen_set_read_only(base, true, NULL); + } job_early_fail(&s->common.job); /* commit_top_bs has to be replaced after deleting the block job, * otherwise this would fail because of lack of permissions. */ --=20 2.11.0