From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtVir-0007pS-8w for qemu-devel@nongnu.org; Tue, 06 May 2008 18:33:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtVim-0007pG-OY for qemu-devel@nongnu.org; Tue, 06 May 2008 18:33:20 -0400 Received: from [199.232.76.173] (port=40375 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtVim-0007pC-I6 for qemu-devel@nongnu.org; Tue, 06 May 2008 18:33:16 -0400 Received: from py-out-1112.google.com ([64.233.166.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JtVim-000211-Ej for qemu-devel@nongnu.org; Tue, 06 May 2008 18:33:16 -0400 Received: by py-out-1112.google.com with SMTP id u52so32570pyb.10 for ; Tue, 06 May 2008 15:33:15 -0700 (PDT) Message-ID: <4820DCA5.2000605@codemonkey.ws> Date: Tue, 06 May 2008 17:33:09 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [4367] Align file accesses with cache=off (Kevin Wolf, Laurent Vivier) References: <4820D905.4020407@bellard.org> In-Reply-To: <4820D905.4020407@bellard.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Fabrice Bellard wrote: > A note: in order to avoid uncontrolled recursions, it is better to call > the read/write AIO callback outside the aio_read/write (see > bdrv_aio_read_em). > > Personally I would not trust the OS to correctly handle the mix of > O_DIRECT and buffered operations, especially if the corresponding file > regions intersect ! > Indeed, why not just allocate a temporary buffer and realign the access such that it's correct? If that involves doing a read first then a write, so be it. Messing with file flags is very dangerous as there may be a request in-flight already in a different thread. I don't think this patch is safe at all. Regards, Anthony Liguori > Fabrice. > > Blue Swirl wrote: > >> Revision: 4367 >> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4367 >> Author: blueswir1 >> Date: 2008-05-06 17:26:59 +0000 (Tue, 06 May 2008) >> >> Log Message: >> ----------- >> Align file accesses with cache=off (Kevin Wolf, Laurent Vivier) >> >> Modified Paths: >> -------------- >> trunk/block-raw-posix.c >> [...] >> > > >