mirror of https://gitee.com/openkylin/linux.git
ext4: Don't mark filesystem error if fallocate fails
If we fail to allocate blocks don't call ext4_error. Also don't hide errors from ext4_get_blocks_wrap Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
f5ab0d1f8f
commit
2c98615d3b
|
@ -2661,13 +2661,14 @@ long ext4_fallocate(struct inode *inode, int mode, loff_t offset, loff_t len)
|
||||||
ret = ext4_get_blocks_wrap(handle, inode, block,
|
ret = ext4_get_blocks_wrap(handle, inode, block,
|
||||||
max_blocks, &map_bh,
|
max_blocks, &map_bh,
|
||||||
EXT4_CREATE_UNINITIALIZED_EXT, 0);
|
EXT4_CREATE_UNINITIALIZED_EXT, 0);
|
||||||
WARN_ON(ret <= 0);
|
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
ext4_error(inode->i_sb, "ext4_fallocate",
|
#ifdef EXT4FS_DEBUG
|
||||||
"ext4_ext_get_blocks returned error: "
|
WARN_ON(ret <= 0);
|
||||||
"inode#%lu, block=%u, max_blocks=%lu",
|
printk(KERN_ERR "%s: ext4_ext_get_blocks "
|
||||||
|
"returned error inode#%lu, block=%u, "
|
||||||
|
"max_blocks=%lu", __func__,
|
||||||
inode->i_ino, block, max_blocks);
|
inode->i_ino, block, max_blocks);
|
||||||
ret = -EIO;
|
#endif
|
||||||
ext4_mark_inode_dirty(handle, inode);
|
ext4_mark_inode_dirty(handle, inode);
|
||||||
ret2 = ext4_journal_stop(handle);
|
ret2 = ext4_journal_stop(handle);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue