Received: from eggs.gnu.org ([2001:4830:134:3::10]:59467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSuaO-0007At-45 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 20:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSuaN-0002Fd-B2 for qemu-devel@nongnu.org; Wed, 05 Jul 2017 20:24:00 -0400 References: <20170705210842.960-1-eblake@redhat.com> <20170705210842.960-21-eblake@redhat.com> From: John Snow Message-ID: <7cd4c11a-26df-6621-9b68-5cf00ff627fe@redhat.com> Date: Wed, 5 Jul 2017 20:23:46 -0400 MIME-Version: 1.0 In-Reply-To: <20170705210842.960-21-eblake@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 20/21] block: Minimize raw use of bds->total_sectors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: kwolf@redhat.com, Fam Zheng , qemu-block@nongnu.org, jcody@redhat.com, Max Reitz , Stefan Hajnoczi On 07/05/2017 05:08 PM, Eric Blake wrote: > bdrv_is_allocated_above() was relying on intermediate->total_sectors, > which is a field that can have stale contents depending on the value > of intermediate->has_variable_length. An audit shows that we are safe > (we were first calling through bdrv_co_get_block_status() which in > turn calls bdrv_nb_sectors() and therefore just refreshed the current > length), but it's nicer to favor our accessor functions to avoid having > to repeat such an audit, even if it means refresh_total_sectors() is > called more frequently. > > Suggested-by: John Snow > Signed-off-by: Eric Blake > Reviewed-by: Manos Pitsidianakis > Reviewed-by: Jeff Cody Reviewed-by: John Snow