From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6M0G-0005zy-RD for qemu-devel@nongnu.org; Tue, 28 Aug 2012 09:38:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6M0A-00064s-Uo for qemu-devel@nongnu.org; Tue, 28 Aug 2012 09:38:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6M0A-00064g-Mv for qemu-devel@nongnu.org; Tue, 28 Aug 2012 09:38:42 -0400 Message-ID: <503CC9DD.8040608@redhat.com> Date: Tue, 28 Aug 2012 15:38:37 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1346159067-28734-1-git-send-email-stefanha@linux.vnet.ibm.com> <503CC6BC.2030101@redhat.com> In-Reply-To: <503CC6BC.2030101@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-1.2] qed: refuse unaligned zero writes with a backing file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org Am 28.08.2012 15:25, schrieb Paolo Bonzini: > Il 28/08/2012 15:04, Stefan Hajnoczi ha scritto: >> Zero writes have cluster granularity in QED. Therefore they can only be >> used to zero entire clusters. >> >> If the zero write request leaves sectors untouched, zeroing the entire >> cluster would obscure the backing file. Instead return -ENOTSUP, which >> is handled by block.c:bdrv_co_do_write_zeroes() and falls back to a >> regular write. >> >> The qemu-iotests 034 test cases covers this scenario. > > Reviewed-by: Paolo Bonzini Thanks, applied to the block branch. > Makes sense since both streaming and copy-on-read will do cluster-aligned writes. > > The "right fix" would not be much more complex though, something like this, right? > (untested). I think Stefan's fix is the right one. It does the same thing as yours and it's much simpler. Kevin