From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56447 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSB5y-0006Ap-Tq for qemu-devel@nongnu.org; Mon, 13 Dec 2010 11:17:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSB5w-0001TS-G7 for qemu-devel@nongnu.org; Mon, 13 Dec 2010 11:17:49 -0500 Received: from mail.codesourcery.com ([38.113.113.100]:33863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSB5w-0001SC-4o for qemu-devel@nongnu.org; Mon, 13 Dec 2010 11:17:48 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 1/5] block: add discard support Date: Mon, 13 Dec 2010 16:17:42 +0000 References: <20101125135657.GA2814@lst.de> <201012111250.20905.paul@codesourcery.com> <20101213154357.GA5730@lst.de> In-Reply-To: <20101213154357.GA5730@lst.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012131617.43385.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: Kevin Wolf , qemu-devel@nongnu.org > 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. Ah, so it was just inconsistent use of the term "block". When the erase region includes part of a block, we zero that part of the block and leave the rest of the block untouched. Paul