public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: Check for the correct error return from ext4_ext_get_blocks
@ 2007-12-03 10:27 Aneesh Kumar K.V
  2007-12-03 15:37 ` Eric Sandeen
  0 siblings, 1 reply; 2+ messages in thread
From: Aneesh Kumar K.V @ 2007-12-03 10:27 UTC (permalink / raw)
  To: akpm; +Cc: linux-ext4, Aneesh Kumar K.V

ext4_ext_get_blocks returns negative values on error. We should
check for  <= 0

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 fs/ext4/extents.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a2475d4..ce57245 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2558,8 +2558,8 @@ retry:
 		ret = ext4_ext_get_blocks(handle, inode, block,
 					  max_blocks, &map_bh,
 					  EXT4_CREATE_UNINITIALIZED_EXT, 0);
-		WARN_ON(!ret);
-		if (!ret) {
+		WARN_ON(ret <= 0);
+		if (ret <= 0) {
 			ext4_error(inode->i_sb, "ext4_fallocate",
 				   "ext4_ext_get_blocks returned 0! inode#%lu"
 				   ", block=%llu, max_blocks=%llu",
-- 
1.5.3.6.985.g65c6a4-dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-03 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03 10:27 [PATCH] ext4: Check for the correct error return from ext4_ext_get_blocks Aneesh Kumar K.V
2007-12-03 15:37 ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox