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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 07 Oct 2009 10:23:34 -0700
From:	Mingming <cmm@...ibm.com>
To:	tytso@....edu
Cc:	ext4 development <linux-ext4@...r.kernel.org>,
	Curt Wohlgemuth <curtw@...gle.com>
Subject: [PATCH 2/2]Fix return value of splitting extents for dio write
 over fallocate

ext4: Fix return value of splitting extents for dio write over fallocate 

To prepare direct IO write, we need to split the unwritten extents before
submit the IO. In case of there is no need to split at all, ext4_split_unwritten_extents()
was incorrectly returns 0 instead of the size of uninitalized extents. This bug
caused the buffer remains unmapped, thus mislead VFS direct IO falling back to buffered IO.

Signed-off-by: Mingming Cao <cmm@...ibm.com>
---
 fs/ext4/extents.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.31-rc4/fs/ext4/extents.c
===================================================================
--- linux-2.6.31-rc4.orig/fs/ext4/extents.c
+++ linux-2.6.31-rc4/fs/ext4/extents.c
@@ -2788,6 +2788,8 @@ fix_extent_len:
  * into three uninitialized extent(at most). After IO complete, the part
  * being filled will be convert to initialized by the end_io callback function
  * via ext4_convert_unwritten_extents().
+ *
+ * Returns the size of unitialized extent to be writen, on success.
  */
 static int ext4_split_unwritten_extents(handle_t *handle,
 					struct inode *inode,
@@ -2829,7 +2831,7 @@ static int ext4_split_unwritten_extents(
  	 * uninitialized extent
  	 */
  	if (allocated <= max_blocks)
-		return ret;
+		return allocated;
 
 	err = ext4_ext_get_access(handle, inode, path + depth);
 	if (err)


--
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