diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2008-01-28 23:58:27 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-01-28 23:58:27 -0500 |
commit | 221879c927df05280283a4de6124806c17cc44d4 (patch) | |
tree | c9d1a53dc45c5d7dbe2456cbaee6eb56ed967bb2 /fs/ext4/extents.c | |
parent | f5a7a6b0d9b6af7d46124ed3f6b3995225cb62d0 (diff) |
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 <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 754c0d36d16..8593e59020f 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -2462,12 +2462,12 @@ retry: | |||
2462 | ret = ext4_ext_get_blocks(handle, inode, block, | 2462 | ret = ext4_ext_get_blocks(handle, inode, block, |
2463 | max_blocks, &map_bh, | 2463 | max_blocks, &map_bh, |
2464 | EXT4_CREATE_UNINITIALIZED_EXT, 0); | 2464 | EXT4_CREATE_UNINITIALIZED_EXT, 0); |
2465 | WARN_ON(!ret); | 2465 | WARN_ON(ret <= 0); |
2466 | if (!ret) { | 2466 | if (ret <= 0) { |
2467 | ext4_error(inode->i_sb, "ext4_fallocate", | 2467 | ext4_error(inode->i_sb, "ext4_fallocate", |
2468 | "ext4_ext_get_blocks returned 0! inode#%lu" | 2468 | "ext4_ext_get_blocks returned error: " |
2469 | ", block=%u, max_blocks=%lu", | 2469 | "inode#%lu, block=%u, max_blocks=%lu", |
2470 | inode->i_ino, block, max_blocks); | 2470 | inode->i_ino, block, max_blocks); |
2471 | ret = -EIO; | 2471 | ret = -EIO; |
2472 | ext4_mark_inode_dirty(handle, inode); | 2472 | ext4_mark_inode_dirty(handle, inode); |
2473 | ret2 = ext4_journal_stop(handle); | 2473 | ret2 = ext4_journal_stop(handle); |