linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Jan Kara <jack@suse.cz>, Dave Chinner <david@fromorbit.com>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	Matthew Wilcox <willy@linux.intel.com>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 0/2] Fix dax races between page faults RFC only
Date: Thu, 28 Jan 2016 13:48:31 +0100	[thread overview]
Message-ID: <20160128124831.GG7726@quack.suse.cz> (raw)
In-Reply-To: <1453867708-3999-1-git-send-email-matthew.r.wilcox@intel.com>

On Tue 26-01-16 23:08:26, Matthew Wilcox wrote:
> From: Matthew Wilcox <willy@linux.intel.com>
> 
> I haven't had time to boot these patches yet, much less split them apart
> into properly reviewable chunks.  I just wanted to get the current state
> of my tree out before Dave & Jan wake up.
> 
> The first patch you've seen before; it was patch 2/8 in the PUD patch
> series I posted on January 6th.  It seemed like a good place to start
> since it unifies a lot of fault handling.
> 
> The second patch is everything else we've talked about rolled into one.
> It looks pretty good to me; after I make sure that it boots and passes
> some smoke tests, I'll add the optimisation Jan & I discussed today
> about trying to reduce the times we have to take the allocation lock in
> exclusive/write mode.
> 
> If I understand the current state of the code correctly, truncate can't
> race with the fault handler, so the re-checks we do of i_size are now
> dead code, which can be deleted. right?

Those i_size checks are still needed. You are right that the locking
protects DAX code to run in parallel to truncate but truncate may happen
after we look at VMA & PTE and before we grab appropriate fs lock in the
fault handler. So if we didn't check for i_size under the lock, we risk
that we would e.g. ask the filesystem to allocate blocks beyond EOF and
those blocks would never be truncated. The fault itself will be fine since
once we return from the fault handler, we'll notice the PTE changed and
retry the fault but those dangling FS blocks would we be bad.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      parent reply	other threads:[~2016-01-28 12:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27  4:08 [PATCH 0/2] Fix dax races between page faults RFC only Matthew Wilcox
2016-01-27  4:08 ` [PATCH 1/2] mm,fs,dax: Change ->pmd_fault to ->huge_fault Matthew Wilcox
2016-01-27  5:48   ` kbuild test robot
2016-01-27 17:47   ` Ross Zwisler
2016-01-28 12:17   ` Jan Kara
2016-01-29 14:31     ` Matthew Wilcox
2016-01-27  4:08 ` [PATCH 2/2] dax: Giant hack Matthew Wilcox
2016-01-28 13:10   ` Jan Kara
2016-01-28 21:23   ` Dave Chinner
2016-01-29 22:29   ` Jared Hulbert
     [not found] ` <CAOxpaSU_JgkeS=u61zxWTdP5hXymBkUsvkjkwNzm6XVig9y8RQ@mail.gmail.com>
2016-01-27  6:18   ` [PATCH 0/2] Fix dax races between page faults RFC only Matthew Wilcox
2016-02-01 21:25     ` Ross Zwisler
2016-01-28 12:48 ` Jan Kara [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=20160128124831.GG7726@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=matthew.r.wilcox@intel.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=willy@linux.intel.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).