Commit 92b97816 authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: change some printk() calls to use ext4_msg() instead

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent d9ee81da
...@@ -425,8 +425,9 @@ static int call_filldir(struct file *filp, void *dirent, ...@@ -425,8 +425,9 @@ static int call_filldir(struct file *filp, void *dirent,
sb = inode->i_sb; sb = inode->i_sb;
if (!fname) { if (!fname) {
printk(KERN_ERR "EXT4-fs: call_filldir: called with " ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: comm %s: "
"null fname?!?\n"); "called with null fname?!?", __func__, __LINE__,
inode->i_ino, current->comm);
return 0; return 0;
} }
curr_pos = hash2pos(fname->hash, fname->minor_hash); curr_pos = hash2pos(fname->hash, fname->minor_hash);
......
...@@ -2728,17 +2728,17 @@ void ext4_ext_init(struct super_block *sb) ...@@ -2728,17 +2728,17 @@ void ext4_ext_init(struct super_block *sb)
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) { if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
#if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS) #if defined(AGGRESSIVE_TEST) || defined(CHECK_BINSEARCH) || defined(EXTENTS_STATS)
printk(KERN_INFO "EXT4-fs: file extents enabled"); printk(KERN_INFO "EXT4-fs: file extents enabled"
#ifdef AGGRESSIVE_TEST #ifdef AGGRESSIVE_TEST
printk(", aggressive tests"); ", aggressive tests"
#endif #endif
#ifdef CHECK_BINSEARCH #ifdef CHECK_BINSEARCH
printk(", check binsearch"); ", check binsearch"
#endif #endif
#ifdef EXTENTS_STATS #ifdef EXTENTS_STATS
printk(", stats"); ", stats"
#endif #endif
printk("\n"); "\n");
#endif #endif
#ifdef EXTENTS_STATS #ifdef EXTENTS_STATS
spin_lock_init(&EXT4_SB(sb)->s_ext_stats_lock); spin_lock_init(&EXT4_SB(sb)->s_ext_stats_lock);
...@@ -4412,10 +4412,11 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, ...@@ -4412,10 +4412,11 @@ int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
EXT4_GET_BLOCKS_IO_CONVERT_EXT); EXT4_GET_BLOCKS_IO_CONVERT_EXT);
if (ret <= 0) { if (ret <= 0) {
WARN_ON(ret <= 0); WARN_ON(ret <= 0);
printk(KERN_ERR "%s: ext4_ext_map_blocks " ext4_msg(inode->i_sb, KERN_ERR,
"returned error inode#%lu, block=%u, " "%s:%d: inode #%lu: block %u: len %u: "
"max_blocks=%u", __func__, "ext4_ext_map_blocks returned %d",
inode->i_ino, map.m_lblk, map.m_len); __func__, __LINE__, inode->i_ino, map.m_lblk,
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);
......
...@@ -204,19 +204,20 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) ...@@ -204,19 +204,20 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
struct ext4_sb_info *sbi; struct ext4_sb_info *sbi;
int fatal = 0, err, count, cleared; int fatal = 0, err, count, cleared;
if (atomic_read(&inode->i_count) > 1) { if (!sb) {
printk(KERN_ERR "ext4_free_inode: inode has count=%d\n", printk(KERN_ERR "EXT4-fs: %s:%d: inode on "
atomic_read(&inode->i_count)); "nonexistent device\n", __func__, __LINE__);
return; return;
} }
if (inode->i_nlink) { if (atomic_read(&inode->i_count) > 1) {
printk(KERN_ERR "ext4_free_inode: inode has nlink=%d\n", ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: count=%d",
inode->i_nlink); __func__, __LINE__, inode->i_ino,
atomic_read(&inode->i_count));
return; return;
} }
if (!sb) { if (inode->i_nlink) {
printk(KERN_ERR "ext4_free_inode: inode on " ext4_msg(sb, KERN_ERR, "%s:%d: inode #%lu: nlink=%d\n",
"nonexistent device\n"); __func__, __LINE__, inode->i_ino, inode->i_nlink);
return; return;
} }
sbi = EXT4_SB(sb); sbi = EXT4_SB(sb);
......
...@@ -1428,20 +1428,22 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd) ...@@ -1428,20 +1428,22 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd)
static void ext4_print_free_blocks(struct inode *inode) static void ext4_print_free_blocks(struct inode *inode)
{ {
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
printk(KERN_CRIT "Total free blocks count %lld\n", struct super_block *sb = inode->i_sb;
ext4_msg(sb, KERN_CRIT, "Total free blocks count %lld",
EXT4_C2B(EXT4_SB(inode->i_sb), EXT4_C2B(EXT4_SB(inode->i_sb),
ext4_count_free_clusters(inode->i_sb))); ext4_count_free_clusters(inode->i_sb)));
printk(KERN_CRIT "Free/Dirty block details\n"); ext4_msg(sb, KERN_CRIT, "Free/Dirty block details");
printk(KERN_CRIT "free_blocks=%lld\n", ext4_msg(sb, KERN_CRIT, "free_blocks=%lld",
(long long) EXT4_C2B(EXT4_SB(inode->i_sb), (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
percpu_counter_sum(&sbi->s_freeclusters_counter))); percpu_counter_sum(&sbi->s_freeclusters_counter)));
printk(KERN_CRIT "dirty_blocks=%lld\n", ext4_msg(sb, KERN_CRIT, "dirty_blocks=%lld",
(long long) EXT4_C2B(EXT4_SB(inode->i_sb), (long long) EXT4_C2B(EXT4_SB(inode->i_sb),
percpu_counter_sum(&sbi->s_dirtyclusters_counter))); percpu_counter_sum(&sbi->s_dirtyclusters_counter)));
printk(KERN_CRIT "Block reservation details\n"); ext4_msg(sb, KERN_CRIT, "Block reservation details");
printk(KERN_CRIT "i_reserved_data_blocks=%u\n", ext4_msg(sb, KERN_CRIT, "i_reserved_data_blocks=%u",
EXT4_I(inode)->i_reserved_data_blocks); EXT4_I(inode)->i_reserved_data_blocks);
printk(KERN_CRIT "i_reserved_meta_blocks=%u\n", ext4_msg(sb, KERN_CRIT, "i_reserved_meta_blocks=%u",
EXT4_I(inode)->i_reserved_meta_blocks); EXT4_I(inode)->i_reserved_meta_blocks);
return; return;
} }
...@@ -2809,8 +2811,9 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate) ...@@ -2809,8 +2811,9 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)
goto out; goto out;
if (!(io_end->inode->i_sb->s_flags & MS_ACTIVE)) { if (!(io_end->inode->i_sb->s_flags & MS_ACTIVE)) {
printk("sb umounted, discard end_io request for inode %lu\n", ext4_msg(io_end->inode->i_sb, KERN_INFO,
io_end->inode->i_ino); "sb umounted, discard end_io request for inode %lu",
io_end->inode->i_ino);
ext4_free_io_end(io_end); ext4_free_io_end(io_end);
goto out; goto out;
} }
......
...@@ -1512,16 +1512,17 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es, ...@@ -1512,16 +1512,17 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
o_blocks_count = ext4_blocks_count(es); o_blocks_count = ext4_blocks_count(es);
if (test_opt(sb, DEBUG)) if (test_opt(sb, DEBUG))
printk(KERN_DEBUG "EXT4-fs: extending last group from %llu to %llu blocks\n", ext4_msg(sb, KERN_DEBUG,
o_blocks_count, n_blocks_count); "extending last group from %llu to %llu blocks",
o_blocks_count, n_blocks_count);
if (n_blocks_count == 0 || n_blocks_count == o_blocks_count) if (n_blocks_count == 0 || n_blocks_count == o_blocks_count)
return 0; return 0;
if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) { if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) {
printk(KERN_ERR "EXT4-fs: filesystem on %s:" ext4_msg(sb, KERN_ERR,
" too large to resize to %llu blocks safely\n", "filesystem too large to resize to %llu blocks safely",
sb->s_id, n_blocks_count); n_blocks_count);
if (sizeof(sector_t) < 8) if (sizeof(sector_t) < 8)
ext4_warning(sb, "CONFIG_LBDAF not enabled"); ext4_warning(sb, "CONFIG_LBDAF not enabled");
return -EINVAL; return -EINVAL;
...@@ -1591,8 +1592,8 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count) ...@@ -1591,8 +1592,8 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
o_blocks_count = ext4_blocks_count(es); o_blocks_count = ext4_blocks_count(es);
if (test_opt(sb, DEBUG)) if (test_opt(sb, DEBUG))
printk(KERN_DEBUG "EXT4-fs: resizing filesystem from %llu " ext4_msg(sb, KERN_DEBUG, "resizing filesystem from %llu "
"upto %llu blocks\n", o_blocks_count, n_blocks_count); "to %llu blocks", o_blocks_count, n_blocks_count);
if (n_blocks_count < o_blocks_count) { if (n_blocks_count < o_blocks_count) {
/* On-line shrinking not supported */ /* On-line shrinking not supported */
...@@ -1676,7 +1677,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count) ...@@ -1676,7 +1677,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
iput(resize_inode); iput(resize_inode);
if (test_opt(sb, DEBUG)) if (test_opt(sb, DEBUG))
printk(KERN_DEBUG "EXT4-fs: resized filesystem from %llu " ext4_msg(sb, KERN_DEBUG, "resized filesystem from %llu "
"upto %llu blocks\n", o_blocks_count, n_blocks_count); "upto %llu blocks", o_blocks_count, n_blocks_count);
return err; return err;
} }
...@@ -376,7 +376,7 @@ void ext4_journal_abort_handle(const char *caller, unsigned int line, ...@@ -376,7 +376,7 @@ void ext4_journal_abort_handle(const char *caller, unsigned int line,
if (is_handle_aborted(handle)) if (is_handle_aborted(handle))
return; return;
printk(KERN_ERR "%s:%d: aborting transaction: %s in %s\n", printk(KERN_ERR "EXT4-fs: %s:%d: aborting transaction: %s in %s\n",
caller, line, errstr, err_fn); caller, line, errstr, err_fn);
jbd2_journal_abort_handle(handle); jbd2_journal_abort_handle(handle);
...@@ -2809,7 +2809,7 @@ static int ext4_run_lazyinit_thread(void) ...@@ -2809,7 +2809,7 @@ static int ext4_run_lazyinit_thread(void)
ext4_clear_request_list(); ext4_clear_request_list();
kfree(ext4_li_info); kfree(ext4_li_info);
ext4_li_info = NULL; ext4_li_info = NULL;
printk(KERN_CRIT "EXT4: error %d creating inode table " printk(KERN_CRIT "EXT4-fs: error %d creating inode table "
"initialization thread\n", "initialization thread\n",
err); err);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment