From: Josef Bacik <jbacik@fusionio.com>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: "Chris L. Mason" <clmason@fusionio.com>,
Josef Bacik <JBacik@fusionio.com>,
Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH V2] Btrfs: fix old data problem caused by aio vs dio
Date: Tue, 26 Jun 2012 08:56:11 -0400 [thread overview]
Message-ID: <20120626125611.GB2046@localhost.localdomain> (raw)
In-Reply-To: <4FE95195.3080402@cn.fujitsu.com>
On Tue, Jun 26, 2012 at 12:07:17AM -0600, Miao Xie wrote:
> The 209th case of xfstests failed because of the race between aio and dio. The
> detail reason is following:
> Task1 Task2 Btrfs-worker
> invalidate pages
> read pages
> do direct io
> invalidate pages fail*
> finish ordered io
> read data from
> pages
>
This just papers over the problem and makes DIO touch page cache which it
shouldn't be doing if it's working properly, so NAK. We need to figure out why
exactly my patch didn't work, since it should be working. The write should be
doing
lock_extent
setup ordered extent
unlock_extent
and the read should be doing
lock_extent
check for ordered extent
if there is one unlock and wait and then loop
do read
unlock_extent
there should be no room for races in here. The patch I sent earlier should have
caught if we had done a read between the invalidate and the locking and should
be invalidating the range again and then checking. If this isn't working then
something else is going sideways and we really need to figure out what it is
rather than just working around the issue, as it will likely bite us in a
different way later. Thanks,
Josef
prev parent reply other threads:[~2012-06-26 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 6:07 [PATCH V2] Btrfs: fix old data problem caused by aio vs dio Miao Xie
2012-06-26 12:56 ` Josef Bacik [this message]
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=20120626125611.GB2046@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=clmason@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=miaox@cn.fujitsu.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 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).