From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:33462 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbcKDXzh (ORCPT ); Fri, 4 Nov 2016 19:55:37 -0400 Date: Fri, 4 Nov 2016 16:55:27 -0700 From: Liu Bo To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, Ross Zwisler Subject: Re: [PATCH] DAX: use proper length when the range is not aligned to PAGE_SIZE Message-ID: <20161104235526.GA7810@localhost.localdomain> Reply-To: bo.li.liu@oracle.com References: <1478287031-3303-1-git-send-email-bo.li.liu@oracle.com> <20161104214822.GA17647@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161104214822.GA17647@quack2.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Nov 04, 2016 at 10:48:22PM +0100, Jan Kara wrote: > On Fri 04-11-16 12:17:11, Liu Bo wrote: > > Currently if we write to [2k, 6k] where pos is 2k and end is 6k, > > get_block() will be called twice, but we can save one get_block > > by sending two blocks together to get_block. > > > > Signed-off-by: Liu Bo > > Thanks for the patch but this code is going to be ripped out soon (in the > next merge window) in favor of iomap DAX implementation. So there's not > much point in fixing this... I see, thanks for the explanation. Thanks, -liubo > > Honza > > > --- > > fs/dax.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/dax.c b/fs/dax.c > > index 53eb6a0..8d4bd5f 100644 > > --- a/fs/dax.c > > +++ b/fs/dax.c > > @@ -172,7 +172,7 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, > > long size; > > > > if (pos == bh_max) { > > - bh->b_size = PAGE_ALIGN(end - pos); > > + bh->b_size = PAGE_ALIGN(end - (pos - first)); > > bh->b_state = 0; > > rc = get_block(inode, block, bh, rw == WRITE); > > if (rc) > > -- > > 2.5.5 > > > -- > Jan Kara > SUSE Labs, CR