From: Aneesh Kumar K.V Date: Tue, 29 Jan 2008 04:58:27 +0000 (-0500) Subject: ext4: Check for the correct error return from X-Git-Tag: v2.6.25-rc1~1166^2~23 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=221879c927df05280283a4de6124806c17cc44d4;p=linux.git ext4: Check for the correct error return from ext4_ext_get_blocks returns negative values on error. We should check for <= 0 Signed-off-by: Aneesh Kumar K.V --- diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 754c0d36d162..8593e59020fe 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2462,12 +2462,12 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len) 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=%u, max_blocks=%lu", - inode->i_ino, block, max_blocks); + "ext4_ext_get_blocks returned error: " + "inode#%lu, block=%u, max_blocks=%lu", + inode->i_ino, block, max_blocks); ret = -EIO; ext4_mark_inode_dirty(handle, inode); ret2 = ext4_journal_stop(handle);