提交 5c752ad9 编写于 作者: A Arjan van de Ven 提交者: Linus Torvalds

Use WARN() in fs/

Use WARN() instead of a printk+WARN_ON() pair; this way the message
becomes part of the warning section for better reporting/collection.
Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5cd2b459
...@@ -1214,8 +1214,7 @@ void __brelse(struct buffer_head * buf) ...@@ -1214,8 +1214,7 @@ void __brelse(struct buffer_head * buf)
put_bh(buf); put_bh(buf);
return; return;
} }
printk(KERN_ERR "VFS: brelse: Trying to free free buffer\n"); WARN(1, KERN_ERR "VFS: brelse: Trying to free free buffer\n");
WARN_ON(1);
} }
/* /*
......
...@@ -309,10 +309,9 @@ static void handle_write_count_underflow(struct vfsmount *mnt) ...@@ -309,10 +309,9 @@ static void handle_write_count_underflow(struct vfsmount *mnt)
*/ */
if ((atomic_read(&mnt->__mnt_writers) < 0) && if ((atomic_read(&mnt->__mnt_writers) < 0) &&
!(mnt->mnt_flags & MNT_IMBALANCED_WRITE_COUNT)) { !(mnt->mnt_flags & MNT_IMBALANCED_WRITE_COUNT)) {
printk(KERN_DEBUG "leak detected on mount(%p) writers " WARN(1, KERN_DEBUG "leak detected on mount(%p) writers "
"count: %d\n", "count: %d\n",
mnt, atomic_read(&mnt->__mnt_writers)); mnt, atomic_read(&mnt->__mnt_writers));
WARN_ON(1);
/* use the flag to keep the dmesg spam down */ /* use the flag to keep the dmesg spam down */
mnt->mnt_flags |= MNT_IMBALANCED_WRITE_COUNT; mnt->mnt_flags |= MNT_IMBALANCED_WRITE_COUNT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册