lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x49y47h6cg2.fsf@segfault.boston.devel.redhat.com>
Date:	Tue, 10 May 2016 13:38:05 -0400
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Eryu Guan <guaneryu@...il.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH v2 1/2] direct-io: cleanup get_more_blocks()

Eryu Guan <guaneryu@...il.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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ