提交 221879c9 编写于 作者: A Aneesh Kumar K.V 提交者: Theodore Ts'o

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: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
上级 f5a7a6b0
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册