linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Kara <jack@suse.cz>
Cc: "Boylston, Brian" <brian.boylston@hpe.com>,
	Jan Kara <jack@suse.com>, Ted Tso <tytso@mit.edu>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	dchinner@redhat.com
Subject: Re: [PATCH 0/9 v3] ext4: Punch hole and DAX fixes
Date: Wed, 11 Nov 2015 09:31:39 +1100	[thread overview]
Message-ID: <20151110223139.GN19199@dastard> (raw)
In-Reply-To: <20151110100253.GF26699@quack.suse.cz>

On Tue, Nov 10, 2015 at 11:02:53AM +0100, Jan Kara wrote:
> On Tue 10-11-15 11:00:27, Dave Chinner wrote:
> > On Mon, Nov 09, 2015 at 05:51:49PM +0100, Jan Kara wrote:
> > > The zeroing code in __dax_fault() needs to go away anyway so whether we
> > > return buffer_new buffer is not really substantial but I'd like to get some
> > > agreement and consistency among filesystems in with which flags zeroed
> > > blocks are returned. Thoughts?
> > 
> > There is no consistency to begin with, especially w.r.t. unwritten
> > extent behaviour as the upper layers don't all understand that
> > buffer_unwritten is a valid flag for getblock to return. Hence we
> > have hacks in XFS setting buffer_new() in strange cases to get the
> > upper level code to zero stuff that really needs zeroing...
> 
> In ext4 we set buffer as new in two cases:
> 
> 1) When it was freshly allocated (regardless whether into unwritten or
>    normal extent).

Which only works for freshly allocated unwritten extents, not for
writes into preallocated extents.

> 2) When it was converted from unwritten to written state.

Which, for direct IO, is no good when we do the conversion after IO
completion because we need to know at IO submission if we need to do
sub-block zeroing (i.e. dio_zero_block() will skip the zeroing if
buffer_new() is not set on unwritten blocks).

Like I said, there's no consistency of behaviour between
filesystems; we do what works for the specific filesystem
algorithms...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2015-11-10 22:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 16:18 [PATCH 0/9 v3] ext4: Punch hole and DAX fixes Jan Kara
2015-11-04 16:18 ` [PATCH 1/9] ext4: Fix races between page faults and hole punching Jan Kara
2015-11-04 16:18 ` [PATCH 2/9] ext4: Move unlocked dio protection from ext4_alloc_file_blocks() Jan Kara
2015-11-04 16:18 ` [PATCH 3/9] ext4: Fix races between buffered IO and collapse / insert range Jan Kara
2015-11-04 16:18 ` [PATCH 4/9] ext4: Fix races of writeback with punch hole and zero range Jan Kara
2015-11-04 16:18 ` [PATCH 5/9] ext4: Document lock ordering Jan Kara
2015-11-04 16:18 ` [PATCH 6/9] ext4: Get rid of EXT4_GET_BLOCKS_NO_LOCK flag Jan Kara
2015-11-04 16:18 ` [PATCH 7/9] ext4: Provide ext4_issue_zeroout() Jan Kara
2015-11-04 16:18 ` [PATCH 8/9] ext4: Implement allocation of pre-zeroed blocks Jan Kara
2015-11-04 16:18 ` [PATCH 9/9] ext4: Use pre-zeroed blocks for DAX page faults Jan Kara
2015-11-04 18:51 ` [PATCH 0/9 v3] ext4: Punch hole and DAX fixes Ross Zwisler
2015-11-06 17:57 ` Boylston, Brian
2015-11-06 22:17   ` Dave Chinner
2015-11-09 16:22   ` Jan Kara
2015-11-09 16:51     ` Jan Kara
2015-11-10  0:00       ` Dave Chinner
2015-11-10 10:02         ` Jan Kara
2015-11-10 22:31           ` Dave Chinner [this message]
2015-11-11 15:25             ` Jan Kara

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=20151110223139.GN19199@dastard \
    --to=david@fromorbit.com \
    --cc=brian.boylston@hpe.com \
    --cc=dan.j.williams@intel.com \
    --cc=dchinner@redhat.com \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=tytso@mit.edu \
    /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).