linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v2 1/2] direct-io: cleanup get_more_blocks()
Date: Tue, 10 May 2016 13:38:05 -0400	[thread overview]
Message-ID: <x49y47h6cg2.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <1462645910-23290-1-git-send-email-guaneryu@gmail.com> (Eryu Guan's message of "Sun, 8 May 2016 02:31:49 +0800")

Eryu Guan <guaneryu@gmail.com> writes:

> Save one level of indention by returning error early.
>
> Introduce some local variables to make the code easier to read a bit,
> and do preparation for next patch.
>
> Signed-off-by: Eryu Guan <guaneryu@gmail.com>

Hi, Eryu,

I don't think you have a full appreciation of the amount of optimization
that goes into this code.  I don't see anything wrong with what you've
done, but I also don't want to introduce all these local variables and
change a branch in order to find out several months down the line that
we introduced some TPC-C regression of .5%.

Look, I think this is all you need for the full fix:

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 4720377..f66754e 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -639,8 +639,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
 		 */
 		create = dio->rw & WRITE;
 		if (dio->flags & DIO_SKIP_HOLES) {
-			if (sdio->block_in_file < (i_size_read(dio->inode) >>
-							sdio->blkbits))
+			if (fs_startblk < fs_count)
 				create = 0;
 		}
 
 
Can you just test that?

Thanks,
Jeff

  parent reply	other threads:[~2016-05-10 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-07 18:31 [PATCH v2 1/2] direct-io: cleanup get_more_blocks() Eryu Guan
2016-05-07 18:31 ` [PATCH v2 2/2] direct-io: fix stale data exposure from concurrent buffered read Eryu Guan
2016-05-11 17:08   ` Jan Kara
2016-05-10 17:38 ` Jeff Moyer [this message]
2016-05-11 13:23   ` [PATCH v2 1/2] direct-io: cleanup get_more_blocks() Eryu Guan
2016-05-11 17:05     ` 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=x49y47h6cg2.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=guaneryu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.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).