Skip to content

Commit

Permalink
Use WARN() in fs/
Browse files Browse the repository at this point in the history
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: Arjan van de Ven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fenrus75 authored and torvalds committed Jul 26, 2008
1 parent 5cd2b45 commit 5c752ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,8 +1214,7 @@ void __brelse(struct buffer_head * buf)
put_bh(buf);
return;
}
printk(KERN_ERR "VFS: brelse: Trying to free free buffer\n");
WARN_ON(1);
WARN(1, KERN_ERR "VFS: brelse: Trying to free free buffer\n");
}

/*
Expand Down
3 changes: 1 addition & 2 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,9 @@ static void handle_write_count_underflow(struct vfsmount *mnt)
*/
if ((atomic_read(&mnt->__mnt_writers) < 0) &&
!(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",
mnt, atomic_read(&mnt->__mnt_writers));
WARN_ON(1);
/* use the flag to keep the dmesg spam down */
mnt->mnt_flags |= MNT_IMBALANCED_WRITE_COUNT;
}
Expand Down

0 comments on commit 5c752ad

Please sign in to comment.