From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 68AE36748B for ; Tue, 12 Jan 2021 12:07:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6089223B70 for ; Tue, 12 Jan 2021 12:07:35 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id E90FD23B66 for ; Tue, 12 Jan 2021 12:07:34 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B2ED645393 for ; Tue, 12 Jan 2021 12:07:34 +0100 (CET) To: Proxmox VE development discussion , Fabian Ebner References: <20210111140024.13377-1-f.ebner@proxmox.com> From: Thomas Lamprecht Message-ID: <85d4649e-faaa-3cbb-3b72-f5cb3caa006b@proxmox.com> Date: Tue, 12 Jan 2021 12:07:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.069 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v2 qemu-server 1/2] tests: mock storage locking for migration tests X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2021 11:07:35 -0000 first, I overlooked your v2 due to lack of reply to Stefans comment there= I did not actually thought there would come one, but my followup seems mostly i= n line with your patch here, so no real harm done.. On 12.01.21 09:03, Fabian Ebner wrote: > I didn't notice yesterday, but it's actually strange that volume_is_bas= e_and_used uses a storage lock. Its callers that plan to change volumes o= n the storage based on the check need to hold the lock instead. Otherwise= it can happen that: > 1. volume_is_base_and_used is called and the result is used to decide h= ow to branch > 2. situation on the storage changes in the meantime > 3. the branch we are taking might not be the one we should be taking an= ymore >=20 > vdisk_free already uses its own lock around both the __no_lock-variant = of the check and the modification on the storage it does, so it's fine. >=20 > The only two callers for the normal variant are in qemu-server and they= both serve as preliminary checks, while the real modification for both o= f them happens with vdisk_free. One of the callers makes the mocking belo= w necessary, but it wouldn't if we were to remove the storage locking fro= m volume_is_base_and_used. Sounds sensible without looking into it in depth yet, can you come up wit= h a patch to do so and look at the specifics?