[{"id":1783572,"web_url":"http://patchwork.ozlabs.org/comment/1783572/","msgid":"<20171010095836.GG4177@dhcp-200-186.str.redhat.com>","list_archive_url":null,"date":"2017-10-10T09:58:36","subject":"Re: [Qemu-devel] [PATCH 13/18] block/mirror: Keep write perm for\n\tpending writes","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 13.09.2017 um 20:19 hat Max Reitz geschrieben:\n> The owner of the mirror BDS might retire its write permission; but there\n> may still be pending mirror operations so the mirror BDS cannot\n> necessarily retire its write permission for its child then.\n> \n> Signed-off-by: Max Reitz <mreitz@redhat.com>\n\nI'm confused. The child of mirror_top_bs is the source, but don't mirror\noperations only write to the target?\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yBCJC32Gvz9tYL\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Oct 2017 20:59:22 +1100 (AEDT)","from localhost ([::1]:33830 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1e1rJm-0003at-LO\n\tfor incoming@patchwork.ozlabs.org; Tue, 10 Oct 2017 05:59:18 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:49263)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1e1rJN-0003ZS-N1\n\tfor qemu-devel@nongnu.org; Tue, 10 Oct 2017 05:58:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1e1rJN-0000iJ-2K\n\tfor qemu-devel@nongnu.org; Tue, 10 Oct 2017 05:58:53 -0400","from mx1.redhat.com ([209.132.183.28]:52500)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1e1rJI-0000eu-MI; Tue, 10 Oct 2017 05:58:48 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 4B6DF641C0;\n\tTue, 10 Oct 2017 09:58:47 +0000 (UTC)","from dhcp-200-186.str.redhat.com (dhcp-200-186.str.redhat.com\n\t[10.33.200.186])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 99B2460630;\n\tTue, 10 Oct 2017 09:58:37 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 4B6DF641C0","Date":"Tue, 10 Oct 2017 11:58:36 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"Max Reitz <mreitz@redhat.com>","Message-ID":"<20171010095836.GG4177@dhcp-200-186.str.redhat.com>","References":"<20170913181910.29688-1-mreitz@redhat.com>\n\t<20170913181910.29688-14-mreitz@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170913181910.29688-14-mreitz@redhat.com>","User-Agent":"Mutt/1.9.1 (2017-09-22)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tTue, 10 Oct 2017 09:58:47 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH 13/18] block/mirror: Keep write perm for\n\tpending writes","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Stefan Hajnoczi <stefanha@redhat.com>, John Snow <jsnow@redhat.com>,\n\tFam Zheng <famz@redhat.com>, qemu-devel@nongnu.org, qemu-block@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1784564,"web_url":"http://patchwork.ozlabs.org/comment/1784564/","msgid":"<711eb725-4ebe-d2ea-7dd1-944b268c55d9@redhat.com>","list_archive_url":null,"date":"2017-10-11T12:20:54","subject":"Re: [Qemu-devel] [PATCH 13/18] block/mirror: Keep write perm for\n\tpending writes","submitter":{"id":36836,"url":"http://patchwork.ozlabs.org/api/people/36836/","name":"Max Reitz","email":"mreitz@redhat.com"},"content":"On 2017-10-10 11:58, Kevin Wolf wrote:\n> Am 13.09.2017 um 20:19 hat Max Reitz geschrieben:\n>> The owner of the mirror BDS might retire its write permission; but there\n>> may still be pending mirror operations so the mirror BDS cannot\n>> necessarily retire its write permission for its child then.\n>>\n>> Signed-off-by: Max Reitz <mreitz@redhat.com>\n> \n> I'm confused. The child of mirror_top_bs is the source, but don't mirror\n> operations only write to the target?\n\nI do know that the iotests added in the end fails without this patch, if\nit helps. :-)\n\nRight, for some reason I never thought about this...  OK, so the issue\nis that if you create a BB, submit a request and then delete it (the\nonly BB), permissions requirements for the mirror BDS are dropped and\nthen it in turn also drops its permissions on the source.\n\nThe issue now occurs whenever the BB is deleted before the write request\nchecks the permissions on the source.  In passive mode, this does not\nhappen because nothing yields before the permission check.\n\nIn active mode, however, active_write_prepare() may yield due to\nmirror_wait_on_conflicts().  Since active_write_prepare() also creates\nan operation (before yielding), this patch \"fixes\" the issue.\n\nI think the real bug fix would be to also have a counter of (write)\noperations running on the source (incremented/decremented in\nbdrv_mirror_top_pwritev()) and to evaluate that in\nbdrv_mirror_top_child_perm().\n\nMax","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mreitz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yBtQB0jr1z9s7p\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 11 Oct 2017 23:21:54 +1100 (AEDT)","from localhost ([::1]:40791 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1e2G1I-0006nb-5W\n\tfor incoming@patchwork.ozlabs.org; Wed, 11 Oct 2017 08:21:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38769)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mreitz@redhat.com>) id 1e2G0j-0006k2-85\n\tfor qemu-devel@nongnu.org; Wed, 11 Oct 2017 08:21:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mreitz@redhat.com>) id 1e2G0h-0001gk-VM\n\tfor qemu-devel@nongnu.org; Wed, 11 Oct 2017 08:21:17 -0400","from mx1.redhat.com ([209.132.183.28]:56178)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mreitz@redhat.com>)\n\tid 1e2G0a-0001dJ-U9; Wed, 11 Oct 2017 08:21:09 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id E104325B99;\n\tWed, 11 Oct 2017 12:21:07 +0000 (UTC)","from dresden.str.redhat.com (unknown [10.40.205.86])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 6A8676C411;\n\tWed, 11 Oct 2017 12:20:56 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E104325B99","To":"Kevin Wolf <kwolf@redhat.com>","References":"<20170913181910.29688-1-mreitz@redhat.com>\n\t<20170913181910.29688-14-mreitz@redhat.com>\n\t<20171010095836.GG4177@dhcp-200-186.str.redhat.com>","From":"Max Reitz <mreitz@redhat.com>","Message-ID":"<711eb725-4ebe-d2ea-7dd1-944b268c55d9@redhat.com>","Date":"Wed, 11 Oct 2017 14:20:54 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20171010095836.GG4177@dhcp-200-186.str.redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"NHQbvRmUcoAROqRXj62UXHH7tkrkfxGvf\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tWed, 11 Oct 2017 12:21:08 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH 13/18] block/mirror: Keep write perm for\n\tpending writes","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Stefan Hajnoczi <stefanha@redhat.com>, John Snow <jsnow@redhat.com>,\n\tFam Zheng <famz@redhat.com>, qemu-devel@nongnu.org, qemu-block@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]