qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [4367] Align file accesses with cache=off (Kevin Wolf,	Laurent Vivier)
Date: Tue, 06 May 2008 17:33:09 -0500	[thread overview]
Message-ID: <4820DCA5.2000605@codemonkey.ws> (raw)
In-Reply-To: <4820D905.4020407@bellard.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
>> [...]
>>     
>
>
>   

  reply	other threads:[~2008-05-06 22:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 17:27 [Qemu-devel] [4367] Align file accesses with cache=off (Kevin Wolf, Laurent Vivier) Blue Swirl
2008-05-06 22:17 ` Fabrice Bellard
2008-05-06 22:33   ` Anthony Liguori [this message]
2008-05-07  7:48   ` Jamie Lokier
2008-05-07  8:16   ` Kevin Wolf
2008-05-07 12:37     ` Jamie Lokier
2008-05-07 13:04       ` Kevin Wolf
2008-05-07 16:19         ` Blue Swirl
2008-05-07 16:39           ` Kevin Wolf
2008-05-07 16:26         ` Jamie Lokier
2008-05-07 17:23           ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4820DCA5.2000605@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).