All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Lalancette <clalance@redhat.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH]: Make Xen 3.1 IDE flush on O_DIRECT with drive caching off
Date: Tue, 26 Feb 2008 09:41:30 -0500	[thread overview]
Message-ID: <47C4251A.3040000@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

All,
     Long ago Xen added code to the device model to basically do an fsync()
after every data write if the user in the guest specified that IDE write caching
should be disabled.  This works fine, except in the case where you are doing
O_DIRECT writes inside the guest (ala dd if=/dev/zero of=/dev/hdb oflag=direct).
 This is because you can get out of ide_write_dma_cb() in the middle of the loop
without going through the logic to sync.  This simple patch makes sure that you
always check (and sync) inside the write callback.

This patch applies to xen-3.1-testing.hg; I still have to test 3.2 (and the new
AIO code) to see if it is affected by this bug.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

[-- Attachment #2: xen-3.1.0-ioemu-odirect-flush.patch --]
[-- Type: text/x-patch, Size: 495 bytes --]

--- xen-3.1.0-src/tools/ioemu/hw/ide.c.orig	2008-02-25 06:46:26.000000000 -0500
+++ xen-3.1.0-src/tools/ioemu/hw/ide.c	2008-02-25 06:46:30.000000000 -0500
@@ -1024,7 +1024,9 @@ static int ide_write_dma_cb(IDEState *s,
 #else  /* !DMA_MULTI_THREAD */
                     ;
 #endif /* DMA_MULTI_THREAD */
-                return 0;
+
+		/* make sure that we (possibly) flush before leaving */
+		break;
             }
             if (n > MAX_MULT_SECTORS)
                 n = MAX_MULT_SECTORS;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2008-02-26 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26 14:41 Chris Lalancette [this message]
2008-02-26 14:51 ` [PATCH]: Make Xen 3.1 IDE flush on O_DIRECT with drive caching off Daniel P. Berrange
2008-02-28  3:23 ` Chris Lalancette

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=47C4251A.3040000@redhat.com \
    --to=clalance@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.