All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ric Wheeler <rwheeler@redhat.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Michal Novotny <minovotn@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extend e2fsprogs functionality to add EXT2_FLAG_DIRECT option
Date: Tue, 12 Jan 2010 11:59:48 -0500	[thread overview]
Message-ID: <4B4CAA84.5060603@redhat.com> (raw)
In-Reply-To: <4B4CA9A6.1080608@redhat.com>

On 01/12/2010 11:56 AM, Eric Sandeen wrote:
> Michal Novotny wrote:
>> On 01/12/2010 05:50 PM, Ric Wheeler wrote:
>>> On 01/12/2010 11:43 AM, Michal Novotny wrote:
>>>> On 01/12/2010 05:38 PM, Christoph Hellwig wrote:
>>>>> Ok, I looked at the issue. The problem is that the Xen backend drivers
>>>>> are (as expected) utterly braindead and submit bios directly from the
>>>>> virtualization backed without using proper abstractions and thus
>>>>> bypassing all the cache coherency features in the fileystems (the block
>>>>> device nodes are just another mini-filesystem in that respect). So
>>>>> when you first have buffered access in the host pages may stay in cache
>>>>> and get overwritten directly on disk by a Xen guest, and once the guest
>>>>> is down the host may still use the now stale cached data.
>>>>>
>>>>> I would recommend to migrate your cutomers to KVM which uses the proper
>>>>> abtractions and thus doesn't have this problem. There's a reason after
>>>>> all why all the Xen dom0 mess never got merged to mainline.
>>>> So, do you think the problem is in the Xen backend drivers and to make
>>>> it working right in Xen the driver fix is needed?
>>>
>>> If XEN drivers by pass the normal IO and FS stack on the host, then I
>>> can understand why the hack to e2fsprogs works but it does not seem
>>> like a good fix.
>>>
>>> Specifically, the data will continue to be cached (and if dirty, might
>>> be written back to the storage eventually).
>>>
>>> If we need a work around, you need to drop VM caches for that device
>>> before you update the guest's files and possibly again afterwards (and
>>> make sure that nothing pulls the data into cache during the operation).
>>>
>>> Basically, this sounds like the backend drivers are doing something
>>> really, really dangerous....
>>>
>>> ric
>>>
>> Ok, so you think this is not good to do this patch for e2fsprogs for
>> direct access support? The only things we could do now is to fix the
>> backend drivers or create a workaround to drop caches? I need to discuss
>> this further with guys in my team...
>
> I do think that patching it up in e2fsprogs is unnecessarily invasive;
> it's fixing it at the wrong spot.
>
> Any block dev IO from the host is dangerous; fixing it only in e2fsprogs
> for this one case doesn't seem like the right course of action.
>
> -Eric

It actually could produce some nastier issues where it would work a bit, the bad 
data gets flushed back to the backing store and then your O_DIRECT read would be 
broken.

Also, for normal users of e2fsprogs, they should never bypass the cache...

ric

  reply	other threads:[~2010-01-12 16:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08  9:36 [PATCH] extend e2fsprogs functionality to add EXT2_FLAG_DIRECT option Michal Novotny
2010-01-11 20:06 ` Ric Wheeler
2010-01-12 10:54   ` Michal Novotny
2010-01-12 11:59     ` Ric Wheeler
2010-01-12 12:15       ` Michal Novotny
2010-01-12 12:23         ` Christoph Hellwig
2010-01-12 12:30           ` Michal Novotny
2010-01-12 12:46             ` Christoph Hellwig
2010-01-12 13:01               ` Michal Novotny
2010-01-12 13:04                 ` Ric Wheeler
2010-01-12 13:12                   ` Michal Novotny
2010-01-12 13:23                     ` Michal Novotny
2010-01-12 13:29                       ` Ric Wheeler
2010-01-12 13:33                         ` Michal Novotny
2010-01-12 14:33                           ` Chris Lee
2010-01-12 14:37                             ` Michal Novotny
2010-01-12 16:38                 ` Christoph Hellwig
2010-01-12 16:43                   ` Michal Novotny
2010-01-12 16:47                     ` Christoph Hellwig
2010-01-12 16:51                       ` Michal Novotny
2010-01-12 16:50                     ` Ric Wheeler
2010-01-12 16:53                       ` Michal Novotny
2010-01-12 16:56                         ` Eric Sandeen
2010-01-12 16:59                           ` Ric Wheeler [this message]
2010-01-12 17:00                             ` Michal Novotny
2010-01-14 13:46                               ` Michal Novotny
2010-01-12 12:47             ` Andreas Dilger
2010-01-12 13:04               ` Michal Novotny
2010-01-12 15:16           ` Eric Sandeen
2010-01-12 15:46             ` Michal Novotny
2010-01-12 20:01               ` Ric Wheeler

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=4B4CAA84.5060603@redhat.com \
    --to=rwheeler@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minovotn@redhat.com \
    --cc=sandeen@redhat.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.