ext4: remove explicit WARN_ON when ext4_map_blocks() fails
In two places we call WARN_ON() before we print out the debug message, however we agreed that the WARN_ON() is unnecessary at those places so remove them. Also use ext4_warning() instead of ext4_msg() and printk(). Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
cfa7275482
commit
b06acd38a4
@ -4462,11 +4462,11 @@ retry:
|
|||||||
ret = ext4_map_blocks(handle, inode, &map, flags);
|
ret = ext4_map_blocks(handle, inode, &map, flags);
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
#ifdef EXT4FS_DEBUG
|
#ifdef EXT4FS_DEBUG
|
||||||
WARN_ON(ret <= 0);
|
ext4_warning(inode->i_sb,
|
||||||
printk(KERN_ERR "%s: ext4_ext_map_blocks "
|
"inode #%lu: block %u: len %u: "
|
||||||
"returned error inode#%lu, block=%u, "
|
"ext4_ext_map_blocks returned %d",
|
||||||
"max_blocks=%u", __func__,
|
inode->i_ino, map.m_lblk,
|
||||||
inode->i_ino, map.m_lblk, max_blocks);
|
map.m_len, ret);
|
||||||
#endif
|
#endif
|
||||||
ext4_mark_inode_dirty(handle, inode);
|
ext4_mark_inode_dirty(handle, inode);
|
||||||
ret2 = ext4_journal_stop(handle);
|
ret2 = ext4_journal_stop(handle);
|
||||||
@ -4539,14 +4539,12 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
|
|||||||
}
|
}
|
||||||
ret = ext4_map_blocks(handle, inode, &map,
|
ret = ext4_map_blocks(handle, inode, &map,
|
||||||
EXT4_GET_BLOCKS_IO_CONVERT_EXT);
|
EXT4_GET_BLOCKS_IO_CONVERT_EXT);
|
||||||
if (ret <= 0) {
|
if (ret <= 0)
|
||||||
WARN_ON(ret <= 0);
|
ext4_warning(inode->i_sb,
|
||||||
ext4_msg(inode->i_sb, KERN_ERR,
|
"inode #%lu: block %u: len %u: "
|
||||||
"%s:%d: inode #%lu: block %u: len %u: "
|
"ext4_ext_map_blocks returned %d",
|
||||||
"ext4_ext_map_blocks returned %d",
|
inode->i_ino, map.m_lblk,
|
||||||
__func__, __LINE__, inode->i_ino, map.m_lblk,
|
map.m_len, ret);
|
||||||
map.m_len, ret);
|
|
||||||
}
|
|
||||||
ext4_mark_inode_dirty(handle, inode);
|
ext4_mark_inode_dirty(handle, inode);
|
||||||
ret2 = ext4_journal_stop(handle);
|
ret2 = ext4_journal_stop(handle);
|
||||||
if (ret <= 0 || ret2 )
|
if (ret <= 0 || ret2 )
|
||||||
|
Loading…
Reference in New Issue
Block a user