linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
Cc: Theodore Ts'o <tytso-3s7WtUTddSA@public.gmane.org>,
	linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	Dave Chinner <david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	Andreas Dilger
	<adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>,
	Alexander Viro
	<viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	Jan Kara <jack-IBi9RG/b67k@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [PATCH 1/7] ext2: tell DAX the size of allocation holes
Date: Tue, 16 Aug 2016 16:52:27 -0600	[thread overview]
Message-ID: <20160816225227.GA632@linux.intel.com> (raw)
In-Reply-To: <20160816091025.GA27284-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>

On Tue, Aug 16, 2016 at 11:10:25AM +0200, Jan Kara wrote:
> On Mon 15-08-16 13:09:12, Ross Zwisler wrote:
> > When DAX calls ext2_get_block() and the file offset points to a hole we
> > currently don't set bh_result->b_size.  When we re-enable PMD faults DAX
> > will need bh_result->b_size to tell it the size of the hole so it can
> > decide whether to fault in a 4 KiB zero page or a 2 MiB zero page.
> > 
> > For ext2 we always want DAX to use 4 KiB zero pages, so we just tell DAX
> > that all holes are 4 KiB in size.
> > 
> > Signed-off-by: Ross Zwisler <ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> > ---
> >  fs/ext2/inode.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> > index d5c7d09..c6d9763 100644
> > --- a/fs/ext2/inode.c
> > +++ b/fs/ext2/inode.c
> > @@ -773,6 +773,12 @@ int ext2_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_
> >  	if (ret > 0) {
> >  		bh_result->b_size = (ret << inode->i_blkbits);
> >  		ret = 0;
> > +	} else if (ret == 0 && IS_DAX(inode)) {
> 
> I'd just drop the IS_DAX() check and set
> 
> 	bh_result->b_size = 1 << inode->i_blkbits;
> 
> IMO it's better to have things consistent between DAX & !DAX whenever
> possible.

Agreed, this is better.  Fixed for v2, thanks!

  parent reply	other threads:[~2016-08-16 22:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 19:09 [PATCH 0/7] re-enable DAX PMD support Ross Zwisler
     [not found] ` <20160815190918.20672-1-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-15 19:09   ` [PATCH 1/7] ext2: tell DAX the size of allocation holes Ross Zwisler
2016-08-16  9:10     ` Jan Kara
     [not found]       ` <20160816091025.GA27284-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-08-16 22:52         ` Ross Zwisler [this message]
2016-08-15 19:09   ` [PATCH 2/7] ext4: " Ross Zwisler
2016-08-16  9:12     ` Jan Kara
2016-08-15 19:09   ` [PATCH 3/7] dax: remove buffer_size_valid() Ross Zwisler
2016-08-16  9:13     ` Jan Kara
2016-08-15 19:09   ` [PATCH 4/7] dax: rename 'ret' to 'entry' in grab_mapping_entry Ross Zwisler
2016-08-16  9:14     ` Jan Kara
2016-08-15 19:09   ` [PATCH 5/7] dax: lock based on slot instead of [mapping, index] Ross Zwisler
2016-08-16  9:28     ` Jan Kara
2016-08-17 20:25       ` Ross Zwisler
     [not found]         ` <20160817202556.GA13009-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-18 14:15           ` Jan Kara
2016-08-15 19:09   ` [PATCH 6/7] dax: re-enable DAX PMD support Ross Zwisler
2016-08-15 19:09   ` [PATCH 7/7] dax: remove "depends on BROKEN" from FS_DAX_PMD Ross Zwisler
2016-08-15 20:21   ` [PATCH 0/7] re-enable DAX PMD support Dan Williams
2016-08-15 21:11     ` Ross Zwisler
2016-08-15 21:14       ` Dan Williams
     [not found]         ` <CAPcyv4i+XHZSN_3T_vcrv+sOkEMQzuTKRo4WBFcPxN=TzSk9iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-17 16:21           ` Ross Zwisler
     [not found]             ` <20160817162124.GA16779-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-17 17:21               ` 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=20160816225227.GA632@linux.intel.com \
    --to=ross.zwisler-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org \
    --cc=jack-AlSwsSmVLrQ@public.gmane.org \
    --cc=jack-IBi9RG/b67k@public.gmane.org \
    --cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
    --cc=tytso-3s7WtUTddSA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
    /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).