From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Lukas Czerner <lczerner@redhat.com>
Subject: [PATCH 1/2] ext4: call WARN_ON after the debug message
Date: Thu, 24 Jan 2013 17:30:43 +0100 [thread overview]
Message-ID: <1359045044-31435-1-git-send-email-lczerner@redhat.com> (raw)
In two places we call WARN_ON() before we print out the debug message,
however the custom is to print such messages before we call WARN_ON() so
change that.
Also use ext4_msg() instead of plain printk().
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
fs/ext4/extents.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 5ae1674..b23e1aa 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4459,11 +4459,12 @@ retry:
ret = ext4_map_blocks(handle, inode, &map, flags);
if (ret <= 0) {
#ifdef EXT4FS_DEBUG
- WARN_ON(ret <= 0);
- printk(KERN_ERR "%s: ext4_ext_map_blocks "
- "returned error inode#%lu, block=%u, "
- "max_blocks=%u", __func__,
- inode->i_ino, map.m_lblk, max_blocks);
+ ext4_msg(inode->i_sb, KERN_ERR,
+ "%s:%d: inode #%lu: block %u: len %u: "
+ "ext4_ext_map_blocks returned %d",
+ __func__, __LINE__, inode->i_ino, map.m_lblk,
+ map.m_len, ret);
+ WARN_ON(1);
#endif
ext4_mark_inode_dirty(handle, inode);
ret2 = ext4_journal_stop(handle);
@@ -4537,12 +4538,12 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
ret = ext4_map_blocks(handle, inode, &map,
EXT4_GET_BLOCKS_IO_CONVERT_EXT);
if (ret <= 0) {
- WARN_ON(ret <= 0);
ext4_msg(inode->i_sb, KERN_ERR,
"%s:%d: inode #%lu: block %u: len %u: "
"ext4_ext_map_blocks returned %d",
__func__, __LINE__, inode->i_ino, map.m_lblk,
map.m_len, ret);
+ WARN_ON(1);
}
ext4_mark_inode_dirty(handle, inode);
ret2 = ext4_journal_stop(handle);
--
1.7.7.6
next reply other threads:[~2013-01-24 16:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-24 16:30 Lukas Czerner [this message]
2013-01-24 16:30 ` [PATCH 2/2] ext4: remove unused variable flags Lukas Czerner
2013-01-24 16:46 ` gnehzuil.liu
2013-01-24 16:44 ` [PATCH 1/2] ext4: call WARN_ON after the debug message gnehzuil.liu
2013-01-24 19:54 ` Theodore Ts'o
2013-01-25 9:22 ` Lukáš Czerner
2013-01-25 15:09 ` Theodore Ts'o
2013-01-25 15:14 ` Lukáš Czerner
2013-01-26 1:00 ` Dave Chinner
2013-01-28 7:10 ` Lukáš Czerner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359045044-31435-1-git-send-email-lczerner@redhat.com \
--to=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).