Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTyja-0005Zo-50 for qemu-devel@nongnu.org; Tue, 26 Feb 2008 07:16:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTyjV-0005YZ-0O for qemu-devel@nongnu.org; Tue, 26 Feb 2008 07:16:33 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTyjU-0005YW-UJ for qemu-devel@nongnu.org; Tue, 26 Feb 2008 07:16:28 -0500 Received: from smtp02.citrix.com ([66.165.176.63]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTyjU-00022l-TG for qemu-devel@nongnu.org; Tue, 26 Feb 2008 07:16:29 -0500 Received: from mariner.uk.xensource.com (mariner.uk.xensource.com [172.31.17.38]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m1QCFhWt008063 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 26 Feb 2008 04:15:45 -0800 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1JTyij-00058W-6Y for qemu-devel@nongnu.org; Tue, 26 Feb 2008 12:15:41 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18372.748.889104.623158@mariner.uk.xensource.com> Date: Tue, 26 Feb 2008 12:15:40 +0000 Subject: Re: [Qemu-devel] [PATCH] ide.c make write cacheing controllable by guest In-Reply-To: <20080225205040.GA18613@shareable.org> References: <18371.1341.577787.909764@mariner.uk.xensource.com> <20080225205040.GA18613@shareable.org> From: Ian Jackson Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jamie Lokier writes ("Re: [Qemu-devel] [PATCH] ide.c make write cacheing controllable by guest"): > However, I notice that it tells the guest that data is committed to > hard storage when the host has merely called fsync(). Yes, that's what fsync is supposed to do. > On Linux (and other host OSes), fdatsync() and fsync() don't always > commit data to hard storage; it sometimes only commits it to the hard > drive cache. (Seriously, just look at fs/ext3/fsync.c; only journal > writes cause the flush, and they aren't done if the inode itself > hasn't changed). As Chris Wedgwood says, I think this is a bug. I was going to quote SuSv3 but sadly it's very vague. > Ideally, the host would provide variation of fdatasync() which flushes > data to hard storage in the same way that kernel filesystem journal > writes can do, and Qemu would use that. Another question arises: do we want bdrv_flush to call (eventually) fsync or fdatasync ? If the latter we need to make sure that we call fsync instead when necessary, for example when a cow file is extended. Ian.