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-next>] [day] [month] [year] [list]
Message-Id: <1246441575-20311-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Date:	Wed,  1 Jul 2009 15:16:15 +0530
From:	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	cmm@...ibm.com, tytso@....edu, sandeen@...hat.com
Cc:	linux-ext4@...r.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH] ext4: Return error if we fail to allocate block in noalloc_get_block_write

block_write_full_page consider a zero return from get_block as success.
noalloc_get_block_write returned zero even if we failed to find a mapping
blocks. Returning non zero ensures we fallback to the error handling path
of block_write_full_page which would properly redirty the page after
the below patch is applied.

http://article.gmane.org/gmane.linux.file-systems/33145

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
---

NOTE: I am not sure whether -EGAIN is the right error to be returned error.
This patch should enable us to push the pending ext4 patches in the patch
queue without depending on the full series from Jan. Will reply to this
email with patch ordering.

 fs/ext4/inode.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 25638bc..6c814af 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2514,7 +2514,10 @@ static int noalloc_get_block_write(struct inode *inode, sector_t iblock,
 	if (ret > 0) {
 		bh_result->b_size = (ret << inode->i_blkbits);
 		ret = 0;
-	}
+	} else if (create && ret == 0)
+		/* write request on unmapped buffer head. */
+		ret = -EAGAIN;
+
 	return ret;
 }
 
-- 
1.6.3.2.363.gc5764

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