From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51007 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSAZP-0003zl-G3 for qemu-devel@nongnu.org; Mon, 13 Dec 2010 10:44:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSAZN-0007yw-EG for qemu-devel@nongnu.org; Mon, 13 Dec 2010 10:44:11 -0500 Received: from verein.lst.de ([213.95.11.210]:46063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSAZN-0007uw-5h for qemu-devel@nongnu.org; Mon, 13 Dec 2010 10:44:09 -0500 Date: Mon, 13 Dec 2010 16:43:57 +0100 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH 1/5] block: add discard support Message-ID: <20101213154357.GA5730@lst.de> References: <20101125135657.GA2814@lst.de> <4CF78D1D.3060107@redhat.com> <20101210133843.GA28846@lst.de> <201012111250.20905.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012111250.20905.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: Kevin Wolf , qemu-devel@nongnu.org, Christoph Hellwig On Sat, Dec 11, 2010 at 12:50:20PM +0000, Paul Brook wrote: > > It's guest visible state, so it must not change due to migrations. For > > the current implementation all values for it work anyway - if it's > > smaller than the block size we'll zero out the remainder of the block. > > That sounds wrong. Surely we should leave partial blocks untouched. While zeroing them is not required for qemu, the general semantics of the XFS ioctl require it. It punches a hole, which means it's makes the new area equivalent to a hole create by truncating a file to a larger size and then only writing at the larger offset. The semantics for a hole in all Unix filesystems is that we read back zeroes from them. If we write into a sparse file at a not block aligned offset the zeroing of the partial block also happens.