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]
Date:	Wed, 5 Sep 2007 19:49:28 +0200
From:	Bernd Schubert <bs@...eap.de>
To:	Randy Dunlap <randy.dunlap@...cle.com>
Cc:	linux-kernel@...r.kernel.org,
	"J. Bruce Fields" <bfields@...ldses.org>, brian@...sterfs.com,
	Goswin von Brederlow <brederlo@...ormatik.uni-tuebingen.de>,
	bs@...eap.de
Subject: Re: patch: improve generic_file_buffered_write() (2nd try 2/2)

I guess when aio was introduced this was probably forgotten. For small chunks 
or synchronous i/o the likehood is correct, but for big data chunks and aio 
the likehood is false.

Signed-off-by: Bernd Schubert <bs@...eap.de>
Signed-off-by: Goswin von Brederlow <goswin@...brederlow.de>

Index: linux-2.6.20.3/mm/filemap.c
===================================================================
--- linux-2.6.20.3.orig/mm/filemap.c	2007-09-05 18:51:59.000000000 +0200
+++ linux-2.6.20.3/mm/filemap.c	2007-09-05 18:53:12.000000000 +0200
@@ -2100,7 +2100,7 @@
 	/*
 	 * handle partial DIO write.  Adjust cur_iov if needed.
 	 */
-	if (likely(nr_segs == 1))
+	if (nr_segs == 1)
 		buf = iov->iov_base + written;
 	else {
 		filemap_set_next_iovec(&cur_iov, &iov_base, written);
@@ -2167,7 +2167,7 @@
 					vmtruncate(inode, isize);
 			}
 		}
-		if (likely(nr_segs == 1))
+		if (nr_segs == 1)
 			copied = filemap_copy_from_user(page, offset,
 							buf, bytes);
 		else
@@ -2213,7 +2213,7 @@
 				count -= copied;
 				pos += copied;
 				buf += copied;
-				if (unlikely(nr_segs > 1)) {
+				if (nr_segs > 1) {
 					filemap_set_next_iovec(&cur_iov,
 							&iov_base, copied);
 					if (count)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ