From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4J28-0003P4-Uu for qemu-devel@nongnu.org; Fri, 17 Jan 2014 18:41:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4J21-0004uk-Hw for qemu-devel@nongnu.org; Fri, 17 Jan 2014 18:41:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4J21-0004uZ-AM for qemu-devel@nongnu.org; Fri, 17 Jan 2014 18:40:57 -0500 Message-ID: <52D9BFED.9000404@redhat.com> Date: Sat, 18 Jan 2014 00:42:37 +0100 From: Max Reitz MIME-Version: 1.0 References: <1389968119-24771-1-git-send-email-kwolf@redhat.com> <1389968119-24771-22-git-send-email-kwolf@redhat.com> In-Reply-To: <1389968119-24771-22-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 21/29] block: Assert serialisation assumptions in pwritev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, pl@kamp.de, xiawenc@linux.vnet.ibm.com, stefanha@redhat.com On 17.01.2014 15:15, Kevin Wolf wrote: > If a request calls wait_serialising_requests() and actually has to wait > in this function (i.e. a coroutine yield), other requests can run and > previously read data (like the head or tail buffer) could become > outdated. In this case, we would have to restart from the beginning to > read in the updated data. > > However, we're lucky and don't actually need to do that: A request can > only wait in the first call of wait_serialising_requests() because we > mark it as serialising before that call, so any later requests would > wait. So as we don't wait in practice, we don't have to reload the data. > > This is an important assumption that may not be broken or data > corruption will happen. Document it with some assertions. > > Signed-off-by: Kevin Wolf > --- > block.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) Reviewed-by: Max Reitz