aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2010-02-15 14:19:27 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-02-15 14:19:27 -0500
commit12062dddda450976b129dcb1bacd91acaf4d8030 (patch)
treee64590b1147639cd3629f8a977b269410cd6bd13 /fs/ext4
parentf710b4b96ba292dfed2153afc47e9063b0abfd89 (diff)
ext4: move __func__ into a macro for ext4_warning, ext4_error
Just a pet peeve of mine; we had a mishash of calls with either __func__ or "function_name" and the latter tends to get out of sync. I think it's easier to just hide the __func__ in a macro, and it'll be consistent from then on. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/balloc.c29
-rw-r--r--fs/ext4/dir.c4
-rw-r--r--fs/ext4/ext4.h7
-rw-r--r--fs/ext4/ext4_jbd2.c2
-rw-r--r--fs/ext4/extents.c9
-rw-r--r--fs/ext4/ialloc.c27
-rw-r--r--fs/ext4/inode.c43
-rw-r--r--fs/ext4/mballoc.c27
-rw-r--r--fs/ext4/move_extent.c12
-rw-r--r--fs/ext4/namei.c51
-rw-r--r--fs/ext4/resize.c102
-rw-r--r--fs/ext4/super.c11
-rw-r--r--fs/ext4/xattr.c32
13 files changed, 146 insertions, 210 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 22bc7435d913..720061a0ee53 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -97,8 +97,8 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
97 /* If checksum is bad mark all blocks used to prevent allocation 97 /* If checksum is bad mark all blocks used to prevent allocation
98 * essentially implementing a per-group read-only flag. */ 98 * essentially implementing a per-group read-only flag. */
99 if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { 99 if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
100 ext4_error(sb, __func__, 100 ext4_error(sb, "Checksum bad for group %u",
101 "Checksum bad for group %u", block_group); 101 block_group);
102 ext4_free_blks_set(sb, gdp, 0); 102 ext4_free_blks_set(sb, gdp, 0);
103 ext4_free_inodes_set(sb, gdp, 0); 103 ext4_free_inodes_set(sb, gdp, 0);
104 ext4_itable_unused_set(sb, gdp, 0); 104 ext4_itable_unused_set(sb, gdp, 0);
@@ -210,10 +210,8 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
210 struct ext4_sb_info *sbi = EXT4_SB(sb); 210 struct ext4_sb_info *sbi = EXT4_SB(sb);
211 211
212 if (block_group >= ngroups) { 212 if (block_group >= ngroups) {
213 ext4_error(sb, "ext4_get_group_desc", 213 ext4_error(sb, "block_group >= groups_count - block_group = %u,"
214 "block_group >= groups_count - " 214 " groups_count = %u", block_group, ngroups);
215 "block_group = %u, groups_count = %u",
216 block_group, ngroups);
217 215
218 return NULL; 216 return NULL;
219 } 217 }
@@ -221,8 +219,7 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
221 group_desc = block_group >> EXT4_DESC_PER_BLOCK_BITS(sb); 219 group_desc = block_group >> EXT4_DESC_PER_BLOCK_BITS(sb);
222 offset = block_group & (EXT4_DESC_PER_BLOCK(sb) - 1); 220 offset = block_group & (EXT4_DESC_PER_BLOCK(sb) - 1);
223 if (!sbi->s_group_desc[group_desc]) { 221 if (!sbi->s_group_desc[group_desc]) {
224 ext4_error(sb, "ext4_get_group_desc", 222 ext4_error(sb, "Group descriptor not loaded - "
225 "Group descriptor not loaded - "
226 "block_group = %u, group_desc = %u, desc = %u", 223 "block_group = %u, group_desc = %u, desc = %u",
227 block_group, group_desc, offset); 224 block_group, group_desc, offset);
228 return NULL; 225 return NULL;
@@ -282,9 +279,7 @@ static int ext4_valid_block_bitmap(struct super_block *sb,
282 return 1; 279 return 1;
283 280
284err_out: 281err_out:
285 ext4_error(sb, __func__, 282 ext4_error(sb, "Invalid block bitmap - block_group = %d, block = %llu",
286 "Invalid block bitmap - "
287 "block_group = %d, block = %llu",
288 block_group, bitmap_blk); 283 block_group, bitmap_blk);
289 return 0; 284 return 0;
290} 285}
@@ -311,8 +306,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
311 bitmap_blk = ext4_block_bitmap(sb, desc); 306 bitmap_blk = ext4_block_bitmap(sb, desc);
312 bh = sb_getblk(sb, bitmap_blk); 307 bh = sb_getblk(sb, bitmap_blk);
313 if (unlikely(!bh)) { 308 if (unlikely(!bh)) {
314 ext4_error(sb, __func__, 309 ext4_error(sb, "Cannot read block bitmap - "
315 "Cannot read block bitmap - "
316 "block_group = %u, block_bitmap = %llu", 310 "block_group = %u, block_bitmap = %llu",
317 block_group, bitmap_blk); 311 block_group, bitmap_blk);
318 return NULL; 312 return NULL;
@@ -354,8 +348,7 @@ ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
354 set_bitmap_uptodate(bh); 348 set_bitmap_uptodate(bh);
355 if (bh_submit_read(bh) < 0) { 349 if (bh_submit_read(bh) < 0) {
356 put_bh(bh); 350 put_bh(bh);
357 ext4_error(sb, __func__, 351 ext4_error(sb, "Cannot read block bitmap - "
358 "Cannot read block bitmap - "
359 "block_group = %u, block_bitmap = %llu", 352 "block_group = %u, block_bitmap = %llu",
360 block_group, bitmap_blk); 353 block_group, bitmap_blk);
361 return NULL; 354 return NULL;
@@ -419,8 +412,7 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
419 in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) || 412 in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) ||
420 in_range(block + count - 1, ext4_inode_table(sb, desc), 413 in_range(block + count - 1, ext4_inode_table(sb, desc),
421 sbi->s_itb_per_group)) { 414 sbi->s_itb_per_group)) {
422 ext4_error(sb, __func__, 415 ext4_error(sb, "Adding blocks in system zones - "
423 "Adding blocks in system zones - "
424 "Block = %llu, count = %lu", 416 "Block = %llu, count = %lu",
425 block, count); 417 block, count);
426 goto error_return; 418 goto error_return;
@@ -453,8 +445,7 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
453 BUFFER_TRACE(bitmap_bh, "clear bit"); 445 BUFFER_TRACE(bitmap_bh, "clear bit");
454 if (!ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group), 446 if (!ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group),
455 bit + i, bitmap_bh->b_data)) { 447 bit + i, bitmap_bh->b_data)) {
456 ext4_error(sb, __func__, 448 ext4_error(sb, "bit already cleared for block %llu",
457 "bit already cleared for block %llu",
458 (ext4_fsblk_t)(block + i)); 449 (ext4_fsblk_t)(block + i));
459 BUFFER_TRACE(bitmap_bh, "bit already cleared"); 450 BUFFER_TRACE(bitmap_bh, "bit already cleared");
460 } else { 451 } else {
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 9dc93168e262..0e0bef3ba91e 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -83,7 +83,7 @@ int ext4_check_dir_entry(const char *function, struct inode *dir,
83 error_msg = "inode out of bounds"; 83 error_msg = "inode out of bounds";
84 84
85 if (error_msg != NULL) 85 if (error_msg != NULL)
86 ext4_error(dir->i_sb, function, 86 __ext4_error(dir->i_sb, function,
87 "bad entry in directory #%lu: %s - " 87 "bad entry in directory #%lu: %s - "
88 "offset=%u, inode=%u, rec_len=%d, name_len=%d", 88 "offset=%u, inode=%u, rec_len=%d, name_len=%d",
89 dir->i_ino, error_msg, offset, 89 dir->i_ino, error_msg, offset,
@@ -150,7 +150,7 @@ static int ext4_readdir(struct file *filp,
150 */ 150 */
151 if (!bh) { 151 if (!bh) {
152 if (!dir_has_error) { 152 if (!dir_has_error) {
153 ext4_error(sb, __func__, "directory #%lu " 153 ext4_error(sb, "directory #%lu "
154 "contains a hole at offset %Lu", 154 "contains a hole at offset %Lu",
155 inode->i_ino, 155 inode->i_ino,
156 (unsigned long long) filp->f_pos); 156 (unsigned long long) filp->f_pos);
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 61cf3b3cde4e..509437ffb71b 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1486,13 +1486,16 @@ extern int ext4_group_extend(struct super_block *sb,
1486 ext4_fsblk_t n_blocks_count); 1486 ext4_fsblk_t n_blocks_count);
1487 1487
1488/* super.c */ 1488/* super.c */
1489extern void ext4_error(struct super_block *, const char *, const char *, ...) 1489extern void __ext4_error(struct super_block *, const char *, const char *, ...)
1490 __attribute__ ((format (printf, 3, 4))); 1490 __attribute__ ((format (printf, 3, 4)));
1491#define ext4_error(sb, message...) __ext4_error(sb, __func__, ## message)
1491extern void __ext4_std_error(struct super_block *, const char *, int); 1492extern void __ext4_std_error(struct super_block *, const char *, int);
1492extern void ext4_abort(struct super_block *, const char *, const char *, ...) 1493extern void ext4_abort(struct super_block *, const char *, const char *, ...)
1493 __attribute__ ((format (printf, 3, 4))); 1494 __attribute__ ((format (printf, 3, 4)));
1494extern void ext4_warning(struct super_block *, const char *, const char *, ...) 1495extern void __ext4_warning(struct super_block *, const char *,
1496 const char *, ...)
1495 __attribute__ ((format (printf, 3, 4))); 1497 __attribute__ ((format (printf, 3, 4)));
1498#define ext4_warning(sb, message...) __ext4_warning(sb, __func__, ## message)
1496extern void ext4_msg(struct super_block *, const char *, const char *, ...) 1499extern void ext4_msg(struct super_block *, const char *, const char *, ...)
1497 __attribute__ ((format (printf, 3, 4))); 1500 __attribute__ ((format (printf, 3, 4)));
1498extern void ext4_grp_locked_error(struct super_block *, ext4_group_t, 1501extern void ext4_grp_locked_error(struct super_block *, ext4_group_t,
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index b57e5c711b6d..2f407c487e6b 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -132,7 +132,7 @@ int __ext4_handle_dirty_metadata(const char *where, handle_t *handle,
132 if (inode && inode_needs_sync(inode)) { 132 if (inode && inode_needs_sync(inode)) {
133 sync_dirty_buffer(bh); 133 sync_dirty_buffer(bh);
134 if (buffer_req(bh) && !buffer_uptodate(bh)) { 134 if (buffer_req(bh) && !buffer_uptodate(bh)) {
135 ext4_error(inode->i_sb, __func__, 135 ext4_error(inode->i_sb,
136 "IO error syncing inode, " 136 "IO error syncing inode, "
137 "inode=%lu, block=%llu", 137 "inode=%lu, block=%llu",
138 inode->i_ino, 138 inode->i_ino,
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 54616157c0f3..bd808915ad2f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -440,7 +440,7 @@ static int __ext4_ext_check(const char *function, struct inode *inode,
440 return 0; 440 return 0;
441 441
442corrupted: 442corrupted:
443 ext4_error(inode->i_sb, function, 443 __ext4_error(inode->i_sb, function,
444 "bad header/extent in inode #%lu: %s - magic %x, " 444 "bad header/extent in inode #%lu: %s - magic %x, "
445 "entries %u, max %u(%u), depth %u(%u)", 445 "entries %u, max %u(%u), depth %u(%u)",
446 inode->i_ino, error_msg, le16_to_cpu(eh->eh_magic), 446 inode->i_ino, error_msg, le16_to_cpu(eh->eh_magic),
@@ -1538,8 +1538,9 @@ int ext4_ext_try_to_merge(struct inode *inode,
1538 merge_done = 1; 1538 merge_done = 1;
1539 WARN_ON(eh->eh_entries == 0); 1539 WARN_ON(eh->eh_entries == 0);
1540 if (!eh->eh_entries) 1540 if (!eh->eh_entries)
1541 ext4_error(inode->i_sb, "ext4_ext_try_to_merge", 1541 ext4_error(inode->i_sb,
1542 "inode#%lu, eh->eh_entries = 0!", inode->i_ino); 1542 "inode#%lu, eh->eh_entries = 0!",
1543 inode->i_ino);
1543 } 1544 }
1544 1545
1545 return merge_done; 1546 return merge_done;
@@ -3238,7 +3239,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
3238 * this is why assert can't be put in ext4_ext_find_extent() 3239 * this is why assert can't be put in ext4_ext_find_extent()
3239 */ 3240 */
3240 if (path[depth].p_ext == NULL && depth != 0) { 3241 if (path[depth].p_ext == NULL && depth != 0) {
3241 ext4_error(inode->i_sb, __func__, "bad extent address " 3242 ext4_error(inode->i_sb, "bad extent address "
3242 "inode: %lu, iblock: %d, depth: %d", 3243 "inode: %lu, iblock: %d, depth: %d",
3243 inode->i_ino, iblock, depth); 3244 inode->i_ino, iblock, depth);
3244 err = -EIO; 3245 err = -EIO;
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 2fab5adae1e2..e4aaf619b56d 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -76,8 +76,7 @@ unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh,
76 /* If checksum is bad mark all blocks and inodes use to prevent 76 /* If checksum is bad mark all blocks and inodes use to prevent
77 * allocation, essentially implementing a per-group read-only flag. */ 77 * allocation, essentially implementing a per-group read-only flag. */
78 if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) { 78 if (!ext4_group_desc_csum_verify(sbi, block_group, gdp)) {
79 ext4_error(sb, __func__, "Checksum bad for group %u", 79 ext4_error(sb, "Checksum bad for group %u", block_group);
80 block_group);
81 ext4_free_blks_set(sb, gdp, 0); 80 ext4_free_blks_set(sb, gdp, 0);
82 ext4_free_inodes_set(sb, gdp, 0); 81 ext4_free_inodes_set(sb, gdp, 0);
83 ext4_itable_unused_set(sb, gdp, 0); 82 ext4_itable_unused_set(sb, gdp, 0);
@@ -111,8 +110,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
111 bitmap_blk = ext4_inode_bitmap(sb, desc); 110 bitmap_blk = ext4_inode_bitmap(sb, desc);
112 bh = sb_getblk(sb, bitmap_blk); 111 bh = sb_getblk(sb, bitmap_blk);
113 if (unlikely(!bh)) { 112 if (unlikely(!bh)) {
114 ext4_error(sb, __func__, 113 ext4_error(sb, "Cannot read inode bitmap - "
115 "Cannot read inode bitmap - "
116 "block_group = %u, inode_bitmap = %llu", 114 "block_group = %u, inode_bitmap = %llu",
117 block_group, bitmap_blk); 115 block_group, bitmap_blk);
118 return NULL; 116 return NULL;
@@ -153,8 +151,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
153 set_bitmap_uptodate(bh); 151 set_bitmap_uptodate(bh);
154 if (bh_submit_read(bh) < 0) { 152 if (bh_submit_read(bh) < 0) {
155 put_bh(bh); 153 put_bh(bh);
156 ext4_error(sb, __func__, 154 ext4_error(sb, "Cannot read inode bitmap - "
157 "Cannot read inode bitmap - "
158 "block_group = %u, inode_bitmap = %llu", 155 "block_group = %u, inode_bitmap = %llu",
159 block_group, bitmap_blk); 156 block_group, bitmap_blk);
160 return NULL; 157 return NULL;
@@ -229,8 +226,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
229 226
230 es = EXT4_SB(sb)->s_es; 227 es = EXT4_SB(sb)->s_es;
231 if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) { 228 if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
232 ext4_error(sb, "ext4_free_inode", 229 ext4_error(sb, "reserved or nonexistent inode %lu", ino);
233 "reserved or nonexistent inode %lu", ino);
234 goto error_return; 230 goto error_return;
235 } 231 }
236 block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb); 232 block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
@@ -248,8 +244,7 @@ void ext4_free_inode(handle_t *handle, struct inode *inode)
248 cleared = ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group), 244 cleared = ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group),
249 bit, bitmap_bh->b_data); 245 bit, bitmap_bh->b_data);
250 if (!cleared) 246 if (!cleared)
251 ext4_error(sb, "ext4_free_inode", 247 ext4_error(sb, "bit already cleared for inode %lu", ino);
252 "bit already cleared for inode %lu", ino);
253 else { 248 else {
254 gdp = ext4_get_group_desc(sb, block_group, &bh2); 249 gdp = ext4_get_group_desc(sb, block_group, &bh2);
255 250
@@ -736,8 +731,7 @@ static int ext4_claim_inode(struct super_block *sb,
736 if ((group == 0 && ino < EXT4_FIRST_INO(sb)) || 731 if ((group == 0 && ino < EXT4_FIRST_INO(sb)) ||
737 ino > EXT4_INODES_PER_GROUP(sb)) { 732 ino > EXT4_INODES_PER_GROUP(sb)) {
738 ext4_unlock_group(sb, group); 733 ext4_unlock_group(sb, group);
739 ext4_error(sb, __func__, 734 ext4_error(sb, "reserved inode or inode > inodes count - "
740 "reserved inode or inode > inodes count - "
741 "block_group = %u, inode=%lu", group, 735 "block_group = %u, inode=%lu", group,
742 ino + group * EXT4_INODES_PER_GROUP(sb)); 736 ino + group * EXT4_INODES_PER_GROUP(sb));
743 return 1; 737 return 1;
@@ -1099,8 +1093,7 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
1099 1093
1100 /* Error cases - e2fsck has already cleaned up for us */ 1094 /* Error cases - e2fsck has already cleaned up for us */
1101 if (ino > max_ino) { 1095 if (ino > max_ino) {
1102 ext4_warning(sb, __func__, 1096 ext4_warning(sb, "bad orphan ino %lu! e2fsck was run?", ino);
1103 "bad orphan ino %lu! e2fsck was run?", ino);
1104 goto error; 1097 goto error;
1105 } 1098 }
1106 1099
@@ -1108,8 +1101,7 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
1108 bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb); 1101 bit = (ino - 1) % EXT4_INODES_PER_GROUP(sb);
1109 bitmap_bh = ext4_read_inode_bitmap(sb, block_group); 1102 bitmap_bh = ext4_read_inode_bitmap(sb, block_group);
1110 if (!bitmap_bh) { 1103 if (!bitmap_bh) {
1111 ext4_warning(sb, __func__, 1104 ext4_warning(sb, "inode bitmap error for orphan %lu", ino);
1112 "inode bitmap error for orphan %lu", ino);
1113 goto error; 1105 goto error;
1114 } 1106 }
1115 1107
@@ -1141,8 +1133,7 @@ iget_failed:
1141 err = PTR_ERR(inode); 1133 err = PTR_ERR(inode);
1142 inode = NULL; 1134 inode = NULL;
1143bad_orphan: 1135bad_orphan:
1144 ext4_warning(sb, __func__, 1136 ext4_warning(sb, "bad orphan inode %lu! e2fsck was run?", ino);
1145 "bad orphan inode %lu! e2fsck was run?", ino);
1146 printk(KERN_NOTICE "ext4_test_bit(bit=%d, block=%llu) = %d\n", 1137 printk(KERN_NOTICE "ext4_test_bit(bit=%d, block=%llu) = %d\n",
1147 bit, (unsigned long long)bitmap_bh->b_blocknr, 1138 bit, (unsigned long long)bitmap_bh->b_blocknr,
1148 ext4_test_bit(bit, bitmap_bh->b_data)); 1139 ext4_test_bit(bit, bitmap_bh->b_data));
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3e530119d7f0..536067bcf75b 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -194,7 +194,7 @@ void ext4_delete_inode(struct inode *inode)
194 inode->i_size = 0; 194 inode->i_size = 0;
195 err = ext4_mark_inode_dirty(handle, inode); 195 err = ext4_mark_inode_dirty(handle, inode);
196 if (err) { 196 if (err) {
197 ext4_warning(inode->i_sb, __func__, 197 ext4_warning(inode->i_sb,
198 "couldn't mark inode dirty (err %d)", err); 198 "couldn't mark inode dirty (err %d)", err);
199 goto stop_handle; 199 goto stop_handle;
200 } 200 }
@@ -212,7 +212,7 @@ void ext4_delete_inode(struct inode *inode)
212 if (err > 0) 212 if (err > 0)
213 err = ext4_journal_restart(handle, 3); 213 err = ext4_journal_restart(handle, 3);
214 if (err != 0) { 214 if (err != 0) {
215 ext4_warning(inode->i_sb, __func__, 215 ext4_warning(inode->i_sb,
216 "couldn't extend journal (err %d)", err); 216 "couldn't extend journal (err %d)", err);
217 stop_handle: 217 stop_handle:
218 ext4_journal_stop(handle); 218 ext4_journal_stop(handle);
@@ -323,8 +323,7 @@ static int ext4_block_to_path(struct inode *inode,
323 offsets[n++] = i_block & (ptrs - 1); 323 offsets[n++] = i_block & (ptrs - 1);
324 final = ptrs; 324 final = ptrs;
325 } else { 325 } else {
326 ext4_warning(inode->i_sb, "ext4_block_to_path", 326 ext4_warning(inode->i_sb, "block %lu > max in inode %lu",
327 "block %lu > max in inode %lu",
328 i_block + direct_blocks + 327 i_block + direct_blocks +
329 indirect_blocks + double_blocks, inode->i_ino); 328 indirect_blocks + double_blocks, inode->i_ino);
330 } 329 }
@@ -344,7 +343,7 @@ static int __ext4_check_blockref(const char *function, struct inode *inode,
344 if (blk && 343 if (blk &&
345 unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb), 344 unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb),
346 blk, 1))) { 345 blk, 1))) {
347 ext4_error(inode->i_sb, function, 346 __ext4_error(inode->i_sb, function,
348 "invalid block reference %u " 347 "invalid block reference %u "
349 "in inode #%lu", blk, inode->i_ino); 348 "in inode #%lu", blk, inode->i_ino);
350 return -EIO; 349 return -EIO;
@@ -1125,7 +1124,7 @@ static int check_block_validity(struct inode *inode, const char *msg,
1125 sector_t logical, sector_t phys, int len) 1124 sector_t logical, sector_t phys, int len)
1126{ 1125{
1127 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), phys, len)) { 1126 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), phys, len)) {
1128 ext4_error(inode->i_sb, msg, 1127 __ext4_error(inode->i_sb, msg,
1129 "inode #%lu logical block %llu mapped to %llu " 1128 "inode #%lu logical block %llu mapped to %llu "
1130 "(size %d)", inode->i_ino, 1129 "(size %d)", inode->i_ino,
1131 (unsigned long long) logical, 1130 (unsigned long long) logical,
@@ -4147,7 +4146,7 @@ static int ext4_clear_blocks(handle_t *handle, struct inode *inode,
4147 4146
4148 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), block_to_free, 4147 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), block_to_free,
4149 count)) { 4148 count)) {
4150 ext4_error(inode->i_sb, __func__, "inode #%lu: " 4149 ext4_error(inode->i_sb, "inode #%lu: "
4151 "attempt to clear blocks %llu len %lu, invalid", 4150 "attempt to clear blocks %llu len %lu, invalid",
4152 inode->i_ino, (unsigned long long) block_to_free, 4151 inode->i_ino, (unsigned long long) block_to_free,
4153 count); 4152 count);
@@ -4255,7 +4254,7 @@ static void ext4_free_data(handle_t *handle, struct inode *inode,
4255 if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh)) 4254 if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh))
4256 ext4_handle_dirty_metadata(handle, inode, this_bh); 4255 ext4_handle_dirty_metadata(handle, inode, this_bh);
4257 else 4256 else
4258 ext4_error(inode->i_sb, __func__, 4257 ext4_error(inode->i_sb,
4259 "circular indirect block detected, " 4258 "circular indirect block detected, "
4260 "inode=%lu, block=%llu", 4259 "inode=%lu, block=%llu",
4261 inode->i_ino, 4260 inode->i_ino,
@@ -4297,7 +4296,7 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
4297 4296
4298 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), 4297 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb),
4299 nr, 1)) { 4298 nr, 1)) {
4300 ext4_error(inode->i_sb, __func__, 4299 ext4_error(inode->i_sb,
4301 "indirect mapped block in inode " 4300 "indirect mapped block in inode "
4302 "#%lu invalid (level %d, blk #%lu)", 4301 "#%lu invalid (level %d, blk #%lu)",
4303 inode->i_ino, depth, 4302 inode->i_ino, depth,
@@ -4313,7 +4312,7 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
4313 * (should be rare). 4312 * (should be rare).
4314 */ 4313 */
4315 if (!bh) { 4314 if (!bh) {
4316 ext4_error(inode->i_sb, "ext4_free_branches", 4315 ext4_error(inode->i_sb,
4317 "Read failure, inode=%lu, block=%llu", 4316 "Read failure, inode=%lu, block=%llu",
4318 inode->i_ino, nr); 4317 inode->i_ino, nr);
4319 continue; 4318 continue;
@@ -4628,9 +4627,8 @@ static int __ext4_get_inode_loc(struct inode *inode,
4628 4627
4629 bh = sb_getblk(sb, block); 4628 bh = sb_getblk(sb, block);
4630 if (!bh) { 4629 if (!bh) {
4631 ext4_error(sb, "ext4_get_inode_loc", "unable to read " 4630 ext4_error(sb, "unable to read inode block - "
4632 "inode block - inode=%lu, block=%llu", 4631 "inode=%lu, block=%llu", inode->i_ino, block);
4633 inode->i_ino, block);
4634 return -EIO; 4632 return -EIO;
4635 } 4633 }
4636 if (!buffer_uptodate(bh)) { 4634 if (!buffer_uptodate(bh)) {
@@ -4728,9 +4726,8 @@ make_io:
4728 submit_bh(READ_META, bh); 4726 submit_bh(READ_META, bh);
4729 wait_on_buffer(bh); 4727 wait_on_buffer(bh);
4730 if (!buffer_uptodate(bh)) { 4728 if (!buffer_uptodate(bh)) {
4731 ext4_error(sb, __func__, 4729 ext4_error(sb, "unable to read inode block - inode=%lu,"
4732 "unable to read inode block - inode=%lu, " 4730 " block=%llu", inode->i_ino, block);
4733 "block=%llu", inode->i_ino, block);
4734 brelse(bh); 4731 brelse(bh);
4735 return -EIO; 4732 return -EIO;
4736 } 4733 }
@@ -4941,8 +4938,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4941 ret = 0; 4938 ret = 0;
4942 if (ei->i_file_acl && 4939 if (ei->i_file_acl &&
4943 !ext4_data_block_valid(EXT4_SB(sb), ei->i_file_acl, 1)) { 4940 !ext4_data_block_valid(EXT4_SB(sb), ei->i_file_acl, 1)) {
4944 ext4_error(sb, __func__, 4941 ext4_error(sb, "bad extended attribute block %llu inode #%lu",
4945 "bad extended attribute block %llu in inode #%lu",
4946 ei->i_file_acl, inode->i_ino); 4942 ei->i_file_acl, inode->i_ino);
4947 ret = -EIO; 4943 ret = -EIO;
4948 goto bad_inode; 4944 goto bad_inode;
@@ -4988,8 +4984,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4988 new_decode_dev(le32_to_cpu(raw_inode->i_block[1]))); 4984 new_decode_dev(le32_to_cpu(raw_inode->i_block[1])));
4989 } else { 4985 } else {
4990 ret = -EIO; 4986 ret = -EIO;
4991 ext4_error(inode->i_sb, __func__, 4987 ext4_error(inode->i_sb, "bogus i_mode (%o) for inode=%lu",
4992 "bogus i_mode (%o) for inode=%lu",
4993 inode->i_mode, inode->i_ino); 4988 inode->i_mode, inode->i_ino);
4994 goto bad_inode; 4989 goto bad_inode;
4995 } 4990 }
@@ -5228,10 +5223,8 @@ int ext4_write_inode(struct inode *inode, int wait)
5228 if (wait) 5223 if (wait)
5229 sync_dirty_buffer(iloc.bh); 5224 sync_dirty_buffer(iloc.bh);
5230 if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) { 5225 if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) {
5231 ext4_error(inode->i_sb, __func__, 5226 ext4_error(inode->i_sb, "IO error syncing inode, "
5232 "IO error syncing inode, " 5227 "inode=%lu, block=%llu", inode->i_ino,
5233 "inode=%lu, block=%llu",
5234 inode->i_ino,
5235 (unsigned long long)iloc.bh->b_blocknr); 5228 (unsigned long long)iloc.bh->b_blocknr);
5236 err = -EIO; 5229 err = -EIO;
5237 } 5230 }
@@ -5644,7 +5637,7 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
5644 EXT4_STATE_NO_EXPAND); 5637 EXT4_STATE_NO_EXPAND);
5645 if (mnt_count != 5638 if (mnt_count !=
5646 le16_to_cpu(sbi->s_es->s_mnt_count)) { 5639 le16_to_cpu(sbi->s_es->s_mnt_count)) {
5647 ext4_warning(inode->i_sb, __func__, 5640 ext4_warning(inode->i_sb,
5648 "Unable to expand inode %lu. Delete" 5641 "Unable to expand inode %lu. Delete"
5649 " some EAs or run e2fsck.", 5642 " some EAs or run e2fsck.",
5650 inode->i_ino); 5643 inode->i_ino);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index d129c1039f1d..415e11f1e9ee 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2709,8 +2709,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2709 2709
2710 len = ac->ac_b_ex.fe_len; 2710 len = ac->ac_b_ex.fe_len;
2711 if (!ext4_data_block_valid(sbi, block, len)) { 2711 if (!ext4_data_block_valid(sbi, block, len)) {
2712 ext4_error(sb, __func__, 2712 ext4_error(sb, "Allocating blocks %llu-%llu which overlap "
2713 "Allocating blocks %llu-%llu which overlap "
2714 "fs metadata\n", block, block+len); 2713 "fs metadata\n", block, block+len);
2715 /* File system mounted not to panic on error 2714 /* File system mounted not to panic on error
2716 * Fix the bitmap and repeat the block allocation 2715 * Fix the bitmap and repeat the block allocation
@@ -3623,15 +3622,13 @@ ext4_mb_discard_group_preallocations(struct super_block *sb,
3623 3622
3624 bitmap_bh = ext4_read_block_bitmap(sb, group); 3623 bitmap_bh = ext4_read_block_bitmap(sb, group);
3625 if (bitmap_bh == NULL) { 3624 if (bitmap_bh == NULL) {
3626 ext4_error(sb, __func__, "Error in reading block " 3625 ext4_error(sb, "Error reading block bitmap for %u", group);
3627 "bitmap for %u", group);
3628 return 0; 3626 return 0;
3629 } 3627 }
3630 3628
3631 err = ext4_mb_load_buddy(sb, group, &e4b); 3629 err = ext4_mb_load_buddy(sb, group, &e4b);
3632 if (err) { 3630 if (err) {
3633 ext4_error(sb, __func__, "Error in loading buddy " 3631 ext4_error(sb, "Error loading buddy information for %u", group);
3634 "information for %u", group);
3635 put_bh(bitmap_bh); 3632 put_bh(bitmap_bh);
3636 return 0; 3633 return 0;
3637 } 3634 }
@@ -3804,15 +3801,15 @@ repeat:
3804 3801
3805 err = ext4_mb_load_buddy(sb, group, &e4b); 3802 err = ext4_mb_load_buddy(sb, group, &e4b);
3806 if (err) { 3803 if (err) {
3807 ext4_error(sb, __func__, "Error in loading buddy " 3804 ext4_error(sb, "Error loading buddy information for %u",
3808 "information for %u", group); 3805 group);
3809 continue; 3806 continue;
3810 } 3807 }
3811 3808
3812 bitmap_bh = ext4_read_block_bitmap(sb, group); 3809 bitmap_bh = ext4_read_block_bitmap(sb, group);
3813 if (bitmap_bh == NULL) { 3810 if (bitmap_bh == NULL) {
3814 ext4_error(sb, __func__, "Error in reading block " 3811 ext4_error(sb, "Error reading block bitmap for %u",
3815 "bitmap for %u", group); 3812 group);
3816 ext4_mb_release_desc(&e4b); 3813 ext4_mb_release_desc(&e4b);
3817 continue; 3814 continue;
3818 } 3815 }
@@ -4077,8 +4074,8 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb,
4077 4074
4078 ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL); 4075 ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, NULL);
4079 if (ext4_mb_load_buddy(sb, group, &e4b)) { 4076 if (ext4_mb_load_buddy(sb, group, &e4b)) {
4080 ext4_error(sb, __func__, "Error in loading buddy " 4077 ext4_error(sb, "Error loading buddy information for %u",
4081 "information for %u", group); 4078 group);
4082 continue; 4079 continue;
4083 } 4080 }
4084 ext4_lock_group(sb, group); 4081 ext4_lock_group(sb, group);
@@ -4478,8 +4475,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
4478 es = EXT4_SB(sb)->s_es; 4475 es = EXT4_SB(sb)->s_es;
4479 if (!(flags & EXT4_FREE_BLOCKS_VALIDATED) && 4476 if (!(flags & EXT4_FREE_BLOCKS_VALIDATED) &&
4480 !ext4_data_block_valid(sbi, block, count)) { 4477 !ext4_data_block_valid(sbi, block, count)) {
4481 ext4_error(sb, __func__, 4478 ext4_error(sb, "Freeing blocks not in datazone - "
4482 "Freeing blocks not in datazone - "
4483 "block = %llu, count = %lu", block, count); 4479 "block = %llu, count = %lu", block, count);
4484 goto error_return; 4480 goto error_return;
4485 } 4481 }
@@ -4548,8 +4544,7 @@ do_more:
4548 in_range(block + count - 1, ext4_inode_table(sb, gdp), 4544 in_range(block + count - 1, ext4_inode_table(sb, gdp),
4549 EXT4_SB(sb)->s_itb_per_group)) { 4545 EXT4_SB(sb)->s_itb_per_group)) {
4550 4546
4551 ext4_error(sb, __func__, 4547 ext4_error(sb, "Freeing blocks in system zone - "
4552 "Freeing blocks in system zone - "
4553 "Block = %llu, count = %lu", block, count); 4548 "Block = %llu, count = %lu", block, count);
4554 /* err = 0. ext4_std_error should be a no op */ 4549 /* err = 0. ext4_std_error should be a no op */
4555 goto error_return; 4550 goto error_return;
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 82c415be87a4..1654eb862d74 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -152,12 +152,12 @@ mext_check_null_inode(struct inode *inode1, struct inode *inode2,
152 int ret = 0; 152 int ret = 0;
153 153
154 if (inode1 == NULL) { 154 if (inode1 == NULL) {
155 ext4_error(inode2->i_sb, function, 155 __ext4_error(inode2->i_sb, function,
156 "Both inodes should not be NULL: " 156 "Both inodes should not be NULL: "
157 "inode1 NULL inode2 %lu", inode2->i_ino); 157 "inode1 NULL inode2 %lu", inode2->i_ino);
158 ret = -EIO; 158 ret = -EIO;
159 } else if (inode2 == NULL) { 159 } else if (inode2 == NULL) {
160 ext4_error(inode1->i_sb, function, 160 __ext4_error(inode1->i_sb, function,
161 "Both inodes should not be NULL: " 161 "Both inodes should not be NULL: "
162 "inode1 %lu inode2 NULL", inode1->i_ino); 162 "inode1 %lu inode2 NULL", inode1->i_ino);
163 ret = -EIO; 163 ret = -EIO;
@@ -526,7 +526,7 @@ mext_leaf_block(handle_t *handle, struct inode *orig_inode,
526 * new_ext |-------| 526 * new_ext |-------|
527 */ 527 */
528 if (le32_to_cpu(oext->ee_block) + oext_alen - 1 < new_ext_end) { 528 if (le32_to_cpu(oext->ee_block) + oext_alen - 1 < new_ext_end) {
529 ext4_error(orig_inode->i_sb, __func__, 529 ext4_error(orig_inode->i_sb,
530 "new_ext_end(%u) should be less than or equal to " 530 "new_ext_end(%u) should be less than or equal to "
531 "oext->ee_block(%u) + oext_alen(%d) - 1", 531 "oext->ee_block(%u) + oext_alen(%d) - 1",
532 new_ext_end, le32_to_cpu(oext->ee_block), 532 new_ext_end, le32_to_cpu(oext->ee_block),
@@ -689,12 +689,12 @@ mext_replace_branches(handle_t *handle, struct inode *orig_inode,
689 while (1) { 689 while (1) {
690 /* The extent for donor must be found. */ 690 /* The extent for donor must be found. */
691 if (!dext) { 691 if (!dext) {
692 ext4_error(donor_inode->i_sb, __func__, 692 ext4_error(donor_inode->i_sb,
693 "The extent for donor must be found"); 693 "The extent for donor must be found");
694 *err = -EIO; 694 *err = -EIO;
695 goto out; 695 goto out;
696 } else if (donor_off != le32_to_cpu(tmp_dext.ee_block)) { 696 } else if (donor_off != le32_to_cpu(tmp_dext.ee_block)) {
697 ext4_error(donor_inode->i_sb, __func__, 697 ext4_error(donor_inode->i_sb,
698 "Donor offset(%u) and the first block of donor " 698 "Donor offset(%u) and the first block of donor "
699 "extent(%u) should be equal", 699 "extent(%u) should be equal",
700 donor_off, 700 donor_off,
@@ -1351,7 +1351,7 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp,
1351 if (ret1 < 0) 1351 if (ret1 < 0)
1352 break; 1352 break;
1353 if (*moved_len > len) { 1353 if (*moved_len > len) {
1354 ext4_error(orig_inode->i_sb, __func__, 1354 ext4_error(orig_inode->i_sb,
1355 "We replaced blocks too much! " 1355 "We replaced blocks too much! "
1356 "sum of replaced: %llu requested: %llu", 1356 "sum of replaced: %llu requested: %llu",
1357 *moved_len, len); 1357 *moved_len, len);
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 17a17e10dd60..bd2dc0b71c8c 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -383,8 +383,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
383 if (root->info.hash_version != DX_HASH_TEA && 383 if (root->info.hash_version != DX_HASH_TEA &&
384 root->info.hash_version != DX_HASH_HALF_MD4 && 384 root->info.hash_version != DX_HASH_HALF_MD4 &&
385 root->info.hash_version != DX_HASH_LEGACY) { 385 root->info.hash_version != DX_HASH_LEGACY) {
386 ext4_warning(dir->i_sb, __func__, 386 ext4_warning(dir->i_sb, "Unrecognised inode hash code %d",
387 "Unrecognised inode hash code %d",
388 root->info.hash_version); 387 root->info.hash_version);
389 brelse(bh); 388 brelse(bh);
390 *err = ERR_BAD_DX_DIR; 389 *err = ERR_BAD_DX_DIR;
@@ -399,8 +398,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
399 hash = hinfo->hash; 398 hash = hinfo->hash;
400 399
401 if (root->info.unused_flags & 1) { 400 if (root->info.unused_flags & 1) {
402 ext4_warning(dir->i_sb, __func__, 401 ext4_warning(dir->i_sb, "Unimplemented inode hash flags: %#06x",
403 "Unimplemented inode hash flags: %#06x",
404 root->info.unused_flags); 402 root->info.unused_flags);
405 brelse(bh); 403 brelse(bh);
406 *err = ERR_BAD_DX_DIR; 404 *err = ERR_BAD_DX_DIR;
@@ -408,8 +406,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
408 } 406 }
409 407
410 if ((indirect = root->info.indirect_levels) > 1) { 408 if ((indirect = root->info.indirect_levels) > 1) {
411 ext4_warning(dir->i_sb, __func__, 409 ext4_warning(dir->i_sb, "Unimplemented inode hash depth: %#06x",
412 "Unimplemented inode hash depth: %#06x",
413 root->info.indirect_levels); 410 root->info.indirect_levels);
414 brelse(bh); 411 brelse(bh);
415 *err = ERR_BAD_DX_DIR; 412 *err = ERR_BAD_DX_DIR;
@@ -421,8 +418,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
421 418
422 if (dx_get_limit(entries) != dx_root_limit(dir, 419 if (dx_get_limit(entries) != dx_root_limit(dir,
423 root->info.info_length)) { 420 root->info.info_length)) {
424 ext4_warning(dir->i_sb, __func__, 421 ext4_warning(dir->i_sb, "dx entry: limit != root limit");
425 "dx entry: limit != root limit");
426 brelse(bh); 422 brelse(bh);
427 *err = ERR_BAD_DX_DIR; 423 *err = ERR_BAD_DX_DIR;
428 goto fail; 424 goto fail;
@@ -433,7 +429,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
433 { 429 {
434 count = dx_get_count(entries); 430 count = dx_get_count(entries);
435 if (!count || count > dx_get_limit(entries)) { 431 if (!count || count > dx_get_limit(entries)) {
436 ext4_warning(dir->i_sb, __func__, 432 ext4_warning(dir->i_sb,
437 "dx entry: no count or count > limit"); 433 "dx entry: no count or count > limit");
438 brelse(bh); 434 brelse(bh);
439 *err = ERR_BAD_DX_DIR; 435 *err = ERR_BAD_DX_DIR;
@@ -478,7 +474,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir,
478 goto fail2; 474 goto fail2;
479 at = entries = ((struct dx_node *) bh->b_data)->entries; 475 at = entries = ((struct dx_node *) bh->b_data)->entries;
480 if (dx_get_limit(entries) != dx_node_limit (dir)) { 476 if (dx_get_limit(entries) != dx_node_limit (dir)) {
481 ext4_warning(dir->i_sb, __func__, 477 ext4_warning(dir->i_sb,
482 "dx entry: limit != node limit"); 478 "dx entry: limit != node limit");
483 brelse(bh); 479 brelse(bh);
484 *err = ERR_BAD_DX_DIR; 480 *err = ERR_BAD_DX_DIR;
@@ -494,7 +490,7 @@ fail2:
494 } 490 }
495fail: 491fail:
496 if (*err == ERR_BAD_DX_DIR) 492 if (*err == ERR_BAD_DX_DIR)
497 ext4_warning(dir->i_sb, __func__, 493 ext4_warning(dir->i_sb,
498 "Corrupt dir inode %ld, running e2fsck is " 494 "Corrupt dir inode %ld, running e2fsck is "
499 "recommended.", dir->i_ino); 495 "recommended.", dir->i_ino);
500 return NULL; 496 return NULL;
@@ -947,9 +943,8 @@ restart:
947 wait_on_buffer(bh); 943 wait_on_buffer(bh);
948 if (!buffer_uptodate(bh)) { 944 if (!buffer_uptodate(bh)) {
949 /* read error, skip block & hope for the best */ 945 /* read error, skip block & hope for the best */
950 ext4_error(sb, __func__, "reading directory #%lu " 946 ext4_error(sb, "reading directory #%lu offset %lu",
951 "offset %lu", dir->i_ino, 947 dir->i_ino, (unsigned long)block);
952 (unsigned long)block);
953 brelse(bh); 948 brelse(bh);
954 goto next; 949 goto next;
955 } 950 }
@@ -1041,7 +1036,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q
1041 retval = ext4_htree_next_block(dir, hash, frame, 1036 retval = ext4_htree_next_block(dir, hash, frame,
1042 frames, NULL); 1037 frames, NULL);
1043 if (retval < 0) { 1038 if (retval < 0) {
1044 ext4_warning(sb, __func__, 1039 ext4_warning(sb,
1045 "error reading index page in directory #%lu", 1040 "error reading index page in directory #%lu",
1046 dir->i_ino); 1041 dir->i_ino);
1047 *err = retval; 1042 *err = retval;
@@ -1071,14 +1066,13 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru
1071 __u32 ino = le32_to_cpu(de->inode); 1066 __u32 ino = le32_to_cpu(de->inode);
1072 brelse(bh); 1067 brelse(bh);
1073 if (!ext4_valid_inum(dir->i_sb, ino)) { 1068 if (!ext4_valid_inum(dir->i_sb, ino)) {
1074 ext4_error(dir->i_sb, "ext4_lookup", 1069 ext4_error(dir->i_sb, "bad inode number: %u", ino);
1075 "bad inode number: %u", ino);
1076 return ERR_PTR(-EIO); 1070 return ERR_PTR(-EIO);
1077 } 1071 }
1078 inode = ext4_iget(dir->i_sb, ino); 1072 inode = ext4_iget(dir->i_sb, ino);
1079 if (unlikely(IS_ERR(inode))) { 1073 if (unlikely(IS_ERR(inode))) {
1080 if (PTR_ERR(inode) == -ESTALE) { 1074 if (PTR_ERR(inode) == -ESTALE) {
1081 ext4_error(dir->i_sb, __func__, 1075 ext4_error(dir->i_sb,
1082 "deleted inode referenced: %u", 1076 "deleted inode referenced: %u",
1083 ino); 1077 ino);
1084 return ERR_PTR(-EIO); 1078 return ERR_PTR(-EIO);
@@ -1110,7 +1104,7 @@ struct dentry *ext4_get_parent(struct dentry *child)
1110 brelse(bh); 1104 brelse(bh);
1111 1105
1112 if (!ext4_valid_inum(child->d_inode->i_sb, ino)) { 1106 if (!ext4_valid_inum(child->d_inode->i_sb, ino)) {
1113 ext4_error(child->d_inode->i_sb, "ext4_get_parent", 1107 ext4_error(child->d_inode->i_sb,
1114 "bad inode number: %u", ino); 1108 "bad inode number: %u", ino);
1115 return ERR_PTR(-EIO); 1109 return ERR_PTR(-EIO);
1116 } 1110 }
@@ -1410,7 +1404,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1410 de = (struct ext4_dir_entry_2 *)((char *)fde + 1404 de = (struct ext4_dir_entry_2 *)((char *)fde +
1411 ext4_rec_len_from_disk(fde->rec_len, blocksize)); 1405 ext4_rec_len_from_disk(fde->rec_len, blocksize));
1412 if ((char *) de >= (((char *) root) + blocksize)) { 1406 if ((char *) de >= (((char *) root) + blocksize)) {
1413 ext4_error(dir->i_sb, __func__, 1407 ext4_error(dir->i_sb,
1414 "invalid rec_len for '..' in inode %lu", 1408 "invalid rec_len for '..' in inode %lu",
1415 dir->i_ino); 1409 dir->i_ino);
1416 brelse(bh); 1410 brelse(bh);
@@ -1575,8 +1569,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1575 1569
1576 if (levels && (dx_get_count(frames->entries) == 1570 if (levels && (dx_get_count(frames->entries) ==
1577 dx_get_limit(frames->entries))) { 1571 dx_get_limit(frames->entries))) {
1578 ext4_warning(sb, __func__, 1572 ext4_warning(sb, "Directory index full!");
1579 "Directory index full!");
1580 err = -ENOSPC; 1573 err = -ENOSPC;
1581 goto cleanup; 1574 goto cleanup;
1582 } 1575 }
@@ -1916,11 +1909,11 @@ static int empty_dir(struct inode *inode)
1916 if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) || 1909 if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) ||
1917 !(bh = ext4_bread(NULL, inode, 0, 0, &err))) { 1910 !(bh = ext4_bread(NULL, inode, 0, 0, &err))) {
1918 if (err) 1911 if (err)
1919 ext4_error(inode->i_sb, __func__, 1912 ext4_error(inode->i_sb,
1920 "error %d reading directory #%lu offset 0", 1913 "error %d reading directory #%lu offset 0",
1921 err, inode->i_ino); 1914 err, inode->i_ino);
1922 else 1915 else
1923 ext4_warning(inode->i_sb, __func__, 1916 ext4_warning(inode->i_sb,
1924 "bad directory (dir #%lu) - no data block", 1917 "bad directory (dir #%lu) - no data block",
1925 inode->i_ino); 1918 inode->i_ino);
1926 return 1; 1919 return 1;
@@ -1931,7 +1924,7 @@ static int empty_dir(struct inode *inode)
1931 !le32_to_cpu(de1->inode) || 1924 !le32_to_cpu(de1->inode) ||
1932 strcmp(".", de->name) || 1925 strcmp(".", de->name) ||
1933 strcmp("..", de1->name)) { 1926 strcmp("..", de1->name)) {
1934 ext4_warning(inode->i_sb, "empty_dir", 1927 ext4_warning(inode->i_sb,
1935 "bad directory (dir #%lu) - no `.' or `..'", 1928 "bad directory (dir #%lu) - no `.' or `..'",
1936 inode->i_ino); 1929 inode->i_ino);
1937 brelse(bh); 1930 brelse(bh);
@@ -1949,7 +1942,7 @@ static int empty_dir(struct inode *inode)
1949 offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err); 1942 offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err);
1950 if (!bh) { 1943 if (!bh) {
1951 if (err) 1944 if (err)
1952 ext4_error(sb, __func__, 1945 ext4_error(sb,
1953 "error %d reading directory" 1946 "error %d reading directory"
1954 " #%lu offset %u", 1947 " #%lu offset %u",
1955 err, inode->i_ino, offset); 1948 err, inode->i_ino, offset);
@@ -2163,7 +2156,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
2163 if (retval) 2156 if (retval)
2164 goto end_rmdir; 2157 goto end_rmdir;
2165 if (!EXT4_DIR_LINK_EMPTY(inode)) 2158 if (!EXT4_DIR_LINK_EMPTY(inode))
2166 ext4_warning(inode->i_sb, "ext4_rmdir", 2159 ext4_warning(inode->i_sb,
2167 "empty directory has too many links (%d)", 2160 "empty directory has too many links (%d)",
2168 inode->i_nlink); 2161 inode->i_nlink);
2169 inode->i_version++; 2162 inode->i_version++;
@@ -2215,7 +2208,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
2215 goto end_unlink; 2208 goto end_unlink;
2216 2209
2217 if (!inode->i_nlink) { 2210 if (!inode->i_nlink) {
2218 ext4_warning(inode->i_sb, "ext4_unlink", 2211 ext4_warning(inode->i_sb,
2219 "Deleting nonexistent file (%lu), %d", 2212 "Deleting nonexistent file (%lu), %d",
2220 inode->i_ino, inode->i_nlink); 2213 inode->i_ino, inode->i_nlink);
2221 inode->i_nlink = 1; 2214 inode->i_nlink = 1;
@@ -2462,7 +2455,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
2462 } 2455 }
2463 } 2456 }
2464 if (retval) { 2457 if (retval) {
2465 ext4_warning(old_dir->i_sb, "ext4_rename", 2458 ext4_warning(old_dir->i_sb,
2466 "Deleting old file (%lu), %d, error=%d", 2459 "Deleting old file (%lu), %d, error=%d",
2467 old_dir->i_ino, old_dir->i_nlink, retval); 2460 old_dir->i_ino, old_dir->i_nlink, retval);
2468 } 2461 }
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 3b2c5541d8a6..5692c48754a0 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -48,65 +48,54 @@ static int verify_group_input(struct super_block *sb,
48 48
49 ext4_get_group_no_and_offset(sb, start, NULL, &offset); 49 ext4_get_group_no_and_offset(sb, start, NULL, &offset);
50 if (group != sbi->s_groups_count) 50 if (group != sbi->s_groups_count)
51 ext4_warning(sb, __func__, 51 ext4_warning(sb, "Cannot add at group %u (only %u groups)",
52 "Cannot add at group %u (only %u groups)",
53 input->group, sbi->s_groups_count); 52 input->group, sbi->s_groups_count);
54 else if (offset != 0) 53 else if (offset != 0)
55 ext4_warning(sb, __func__, "Last group not full"); 54 ext4_warning(sb, "Last group not full");
56 else if (input->reserved_blocks > input->blocks_count / 5) 55 else if (input->reserved_blocks > input->blocks_count / 5)
57 ext4_warning(sb, __func__, "Reserved blocks too high (%u)", 56 ext4_warning(sb, "Reserved blocks too high (%u)",
58 input->reserved_blocks); 57 input->reserved_blocks);
59 else if (free_blocks_count < 0) 58 else if (free_blocks_count < 0)
60 ext4_warning(sb, __func__, "Bad blocks count %u", 59 ext4_warning(sb, "Bad blocks count %u",
61 input->blocks_count); 60 input->blocks_count);
62 else if (!(bh = sb_bread(sb, end - 1))) 61 else if (!(bh = sb_bread(sb, end - 1)))
63 ext4_warning(sb, __func__, 62 ext4_warning(sb, "Cannot read last block (%llu)",
64 "Cannot read last block (%llu)",
65 end - 1); 63 end - 1);
66 else if (outside(input->block_bitmap, start, end)) 64 else if (outside(input->block_bitmap, start, end))
67 ext4_warning(sb, __func__, 65 ext4_warning(sb, "Block bitmap not in group (block %llu)",
68 "Block bitmap not in group (block %llu)",
69 (unsigned long long)input->block_bitmap); 66 (unsigned long long)input->block_bitmap);
70 else if (outside(input->inode_bitmap, start, end)) 67 else if (outside(input->inode_bitmap, start, end))
71 ext4_warning(sb, __func__, 68 ext4_warning(sb, "Inode bitmap not in group (block %llu)",
72 "Inode bitmap not in group (block %llu)",
73 (unsigned long long)input->inode_bitmap); 69 (unsigned long long)input->inode_bitmap);
74 else if (outside(input->inode_table, start, end) || 70 else if (outside(input->inode_table, start, end) ||
75 outside(itend - 1, start, end)) 71 outside(itend - 1, start, end))
76 ext4_warning(sb, __func__, 72 ext4_warning(sb, "Inode table not in group (blocks %llu-%llu)",
77 "Inode table not in group (blocks %llu-%llu)",
78 (unsigned long long)input->inode_table, itend - 1); 73 (unsigned long long)input->inode_table, itend - 1);
79 else if (input->inode_bitmap == input->block_bitmap) 74 else if (input->inode_bitmap == input->block_bitmap)
80 ext4_warning(sb, __func__, 75 ext4_warning(sb, "Block bitmap same as inode bitmap (%llu)",
81 "Block bitmap same as inode bitmap (%llu)",
82 (unsigned long long)input->block_bitmap); 76 (unsigned long long)input->block_bitmap);
83 else if (inside(input->block_bitmap, input->inode_table, itend)) 77 else if (inside(input->block_bitmap, input->inode_table, itend))
84 ext4_warning(sb, __func__, 78 ext4_warning(sb, "Block bitmap (%llu) in inode table "
85 "Block bitmap (%llu) in inode table (%llu-%llu)", 79 "(%llu-%llu)",
86 (unsigned long long)input->block_bitmap, 80 (unsigned long long)input->block_bitmap,
87 (unsigned long long)input->inode_table, itend - 1); 81 (unsigned long long)input->inode_table, itend - 1);
88 else if (inside(input->inode_bitmap, input->inode_table, itend)) 82 else if (inside(input->inode_bitmap, input->inode_table, itend))
89 ext4_warning(sb, __func__, 83 ext4_warning(sb, "Inode bitmap (%llu) in inode table "
90 "Inode bitmap (%llu) in inode table (%llu-%llu)", 84 "(%llu-%llu)",
91 (unsigned long long)input->inode_bitmap, 85 (unsigned long long)input->inode_bitmap,
92 (unsigned long long)input->inode_table, itend - 1); 86 (unsigned long long)input->inode_table, itend - 1);
93 else if (inside(input->block_bitmap, start, metaend)) 87 else if (inside(input->block_bitmap, start, metaend))
94 ext4_warning(sb, __func__, 88 ext4_warning(sb, "Block bitmap (%llu) in GDT table (%llu-%llu)",
95 "Block bitmap (%llu) in GDT table"
96 " (%llu-%llu)",
97 (unsigned long long)input->block_bitmap, 89 (unsigned long long)input->block_bitmap,
98 start, metaend - 1); 90 start, metaend - 1);
99 else if (inside(input->inode_bitmap, start, metaend)) 91 else if (inside(input->inode_bitmap, start, metaend))
100 ext4_warning(sb, __func__, 92 ext4_warning(sb, "Inode bitmap (%llu) in GDT table (%llu-%llu)",
101 "Inode bitmap (%llu) in GDT table"
102 " (%llu-%llu)",
103 (unsigned long long)input->inode_bitmap, 93 (unsigned long long)input->inode_bitmap,
104 start, metaend - 1); 94 start, metaend - 1);
105 else if (inside(input->inode_table, start, metaend) || 95 else if (inside(input->inode_table, start, metaend) ||
106 inside(itend - 1, start, metaend)) 96 inside(itend - 1, start, metaend))
107 ext4_warning(sb, __func__, 97 ext4_warning(sb, "Inode table (%llu-%llu) overlaps GDT table "
108 "Inode table (%llu-%llu) overlaps" 98 "(%llu-%llu)",
109 "GDT table (%llu-%llu)",
110 (unsigned long long)input->inode_table, 99 (unsigned long long)input->inode_table,
111 itend - 1, start, metaend - 1); 100 itend - 1, start, metaend - 1);
112 else 101 else
@@ -364,8 +353,7 @@ static int verify_reserved_gdb(struct super_block *sb,
364 while ((grp = ext4_list_backups(sb, &three, &five, &seven)) < end) { 353 while ((grp = ext4_list_backups(sb, &three, &five, &seven)) < end) {
365 if (le32_to_cpu(*p++) != 354 if (le32_to_cpu(*p++) !=
366 grp * EXT4_BLOCKS_PER_GROUP(sb) + blk){ 355 grp * EXT4_BLOCKS_PER_GROUP(sb) + blk){
367 ext4_warning(sb, __func__, 356 ext4_warning(sb, "reserved GDT %llu"
368 "reserved GDT %llu"
369 " missing grp %d (%llu)", 357 " missing grp %d (%llu)",
370 blk, grp, 358 blk, grp,
371 grp * 359 grp *
@@ -420,8 +408,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
420 */ 408 */
421 if (EXT4_SB(sb)->s_sbh->b_blocknr != 409 if (EXT4_SB(sb)->s_sbh->b_blocknr !=
422 le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) { 410 le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) {
423 ext4_warning(sb, __func__, 411 ext4_warning(sb, "won't resize using backup superblock at %llu",
424 "won't resize using backup superblock at %llu",
425 (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr); 412 (unsigned long long)EXT4_SB(sb)->s_sbh->b_blocknr);
426 return -EPERM; 413 return -EPERM;
427 } 414 }
@@ -444,8 +431,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
444 431
445 data = (__le32 *)dind->b_data; 432 data = (__le32 *)dind->b_data;
446 if (le32_to_cpu(data[gdb_num % EXT4_ADDR_PER_BLOCK(sb)]) != gdblock) { 433 if (le32_to_cpu(data[gdb_num % EXT4_ADDR_PER_BLOCK(sb)]) != gdblock) {
447 ext4_warning(sb, __func__, 434 ext4_warning(sb, "new group %u GDT block %llu not reserved",
448 "new group %u GDT block %llu not reserved",
449 input->group, gdblock); 435 input->group, gdblock);
450 err = -EINVAL; 436 err = -EINVAL;
451 goto exit_dind; 437 goto exit_dind;
@@ -468,7 +454,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
468 GFP_NOFS); 454 GFP_NOFS);
469 if (!n_group_desc) { 455 if (!n_group_desc) {
470 err = -ENOMEM; 456 err = -ENOMEM;
471 ext4_warning(sb, __func__, 457 ext4_warning(sb,
472 "not enough memory for %lu groups", gdb_num + 1); 458 "not enough memory for %lu groups", gdb_num + 1);
473 goto exit_inode; 459 goto exit_inode;
474 } 460 }
@@ -567,8 +553,7 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
567 /* Get each reserved primary GDT block and verify it holds backups */ 553 /* Get each reserved primary GDT block and verify it holds backups */
568 for (res = 0; res < reserved_gdb; res++, blk++) { 554 for (res = 0; res < reserved_gdb; res++, blk++) {
569 if (le32_to_cpu(*data) != blk) { 555 if (le32_to_cpu(*data) != blk) {
570 ext4_warning(sb, __func__, 556 ext4_warning(sb, "reserved block %llu"
571 "reserved block %llu"
572 " not at offset %ld", 557 " not at offset %ld",
573 blk, 558 blk,
574 (long)(data - (__le32 *)dind->b_data)); 559 (long)(data - (__le32 *)dind->b_data));
@@ -713,8 +698,7 @@ static void update_backups(struct super_block *sb,
713 */ 698 */
714exit_err: 699exit_err:
715 if (err) { 700 if (err) {
716 ext4_warning(sb, __func__, 701 ext4_warning(sb, "can't update backup for group %u (err %d), "
717 "can't update backup for group %u (err %d), "
718 "forcing fsck on next reboot", group, err); 702 "forcing fsck on next reboot", group, err);
719 sbi->s_mount_state &= ~EXT4_VALID_FS; 703 sbi->s_mount_state &= ~EXT4_VALID_FS;
720 sbi->s_es->s_state &= cpu_to_le16(~EXT4_VALID_FS); 704 sbi->s_es->s_state &= cpu_to_le16(~EXT4_VALID_FS);
@@ -753,20 +737,19 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
753 737
754 if (gdb_off == 0 && !EXT4_HAS_RO_COMPAT_FEATURE(sb, 738 if (gdb_off == 0 && !EXT4_HAS_RO_COMPAT_FEATURE(sb,
755 EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER)) { 739 EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER)) {
756 ext4_warning(sb, __func__, 740 ext4_warning(sb, "Can't resize non-sparse filesystem further");
757 "Can't resize non-sparse filesystem further");
758 return -EPERM; 741 return -EPERM;
759 } 742 }
760 743
761 if (ext4_blocks_count(es) + input->blocks_count < 744 if (ext4_blocks_count(es) + input->blocks_count <
762 ext4_blocks_count(es)) { 745 ext4_blocks_count(es)) {
763 ext4_warning(sb, __func__, "blocks_count overflow"); 746 ext4_warning(sb, "blocks_count overflow");
764 return -EINVAL; 747 return -EINVAL;
765 } 748 }
766 749
767 if (le32_to_cpu(es->s_inodes_count) + EXT4_INODES_PER_GROUP(sb) < 750 if (le32_to_cpu(es->s_inodes_count) + EXT4_INODES_PER_GROUP(sb) <
768 le32_to_cpu(es->s_inodes_count)) { 751 le32_to_cpu(es->s_inodes_count)) {
769 ext4_warning(sb, __func__, "inodes_count overflow"); 752 ext4_warning(sb, "inodes_count overflow");
770 return -EINVAL; 753 return -EINVAL;
771 } 754 }
772 755
@@ -774,14 +757,13 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
774 if (!EXT4_HAS_COMPAT_FEATURE(sb, 757 if (!EXT4_HAS_COMPAT_FEATURE(sb,
775 EXT4_FEATURE_COMPAT_RESIZE_INODE) 758 EXT4_FEATURE_COMPAT_RESIZE_INODE)
776 || !le16_to_cpu(es->s_reserved_gdt_blocks)) { 759 || !le16_to_cpu(es->s_reserved_gdt_blocks)) {
777 ext4_warning(sb, __func__, 760 ext4_warning(sb,
778 "No reserved GDT blocks, can't resize"); 761 "No reserved GDT blocks, can't resize");
779 return -EPERM; 762 return -EPERM;
780 } 763 }
781 inode = ext4_iget(sb, EXT4_RESIZE_INO); 764 inode = ext4_iget(sb, EXT4_RESIZE_INO);
782 if (IS_ERR(inode)) { 765 if (IS_ERR(inode)) {
783 ext4_warning(sb, __func__, 766 ext4_warning(sb, "Error opening resize inode");
784 "Error opening resize inode");
785 return PTR_ERR(inode); 767 return PTR_ERR(inode);
786 } 768 }
787 } 769 }
@@ -810,8 +792,7 @@ int ext4_group_add(struct super_block *sb, struct ext4_new_group_data *input)
810 792
811 mutex_lock(&sbi->s_resize_lock); 793 mutex_lock(&sbi->s_resize_lock);
812 if (input->group != sbi->s_groups_count) { 794 if (input->group != sbi->s_groups_count) {
813 ext4_warning(sb, __func__, 795 ext4_warning(sb, "multiple resizers run on filesystem!");
814 "multiple resizers run on filesystem!");
815 err = -EBUSY; 796 err = -EBUSY;
816 goto exit_journal; 797 goto exit_journal;
817 } 798 }
@@ -997,13 +978,12 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
997 " too large to resize to %llu blocks safely\n", 978 " too large to resize to %llu blocks safely\n",
998 sb->s_id, n_blocks_count); 979 sb->s_id, n_blocks_count);
999 if (sizeof(sector_t) < 8) 980 if (sizeof(sector_t) < 8)
1000 ext4_warning(sb, __func__, "CONFIG_LBDAF not enabled"); 981 ext4_warning(sb, "CONFIG_LBDAF not enabled");
1001 return -EINVAL; 982 return -EINVAL;
1002 } 983 }
1003 984
1004 if (n_blocks_count < o_blocks_count) { 985 if (n_blocks_count < o_blocks_count) {
1005 ext4_warning(sb, __func__, 986 ext4_warning(sb, "can't shrink FS - resize aborted");
1006 "can't shrink FS - resize aborted");
1007 return -EBUSY; 987 return -EBUSY;
1008 } 988 }
1009 989
@@ -1011,15 +991,14 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1011 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last); 991 ext4_get_group_no_and_offset(sb, o_blocks_count, &group, &last);
1012 992
1013 if (last == 0) { 993 if (last == 0) {
1014 ext4_warning(sb, __func__, 994 ext4_warning(sb, "need to use ext2online to resize further");
1015 "need to use ext2online to resize further");
1016 return -EPERM; 995 return -EPERM;
1017 } 996 }
1018 997
1019 add = EXT4_BLOCKS_PER_GROUP(sb) - last; 998 add = EXT4_BLOCKS_PER_GROUP(sb) - last;
1020 999
1021 if (o_blocks_count + add < o_blocks_count) { 1000 if (o_blocks_count + add < o_blocks_count) {
1022 ext4_warning(sb, __func__, "blocks_count overflow"); 1001 ext4_warning(sb, "blocks_count overflow");
1023 return -EINVAL; 1002 return -EINVAL;
1024 } 1003 }
1025 1004
@@ -1027,16 +1006,13 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1027 add = n_blocks_count - o_blocks_count; 1006 add = n_blocks_count - o_blocks_count;
1028 1007
1029 if (o_blocks_count + add < n_blocks_count) 1008 if (o_blocks_count + add < n_blocks_count)
1030 ext4_warning(sb, __func__, 1009 ext4_warning(sb, "will only finish group (%llu blocks, %u new)",
1031 "will only finish group (%llu"
1032 " blocks, %u new)",
1033 o_blocks_count + add, add); 1010 o_blocks_count + add, add);
1034 1011
1035 /* See if the device is actually as big as what was requested */ 1012 /* See if the device is actually as big as what was requested */
1036 bh = sb_bread(sb, o_blocks_count + add - 1); 1013 bh = sb_bread(sb, o_blocks_count + add - 1);
1037 if (!bh) { 1014 if (!bh) {
1038 ext4_warning(sb, __func__, 1015 ext4_warning(sb, "can't read last block, resize aborted");
1039 "can't read last block, resize aborted");
1040 return -ENOSPC; 1016 return -ENOSPC;
1041 } 1017 }
1042 brelse(bh); 1018 brelse(bh);
@@ -1047,14 +1023,13 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1047 handle = ext4_journal_start_sb(sb, 3); 1023 handle = ext4_journal_start_sb(sb, 3);
1048 if (IS_ERR(handle)) { 1024 if (IS_ERR(handle)) {
1049 err = PTR_ERR(handle); 1025 err = PTR_ERR(handle);
1050 ext4_warning(sb, __func__, "error %d on journal start", err); 1026 ext4_warning(sb, "error %d on journal start", err);
1051 goto exit_put; 1027 goto exit_put;
1052 } 1028 }
1053 1029
1054 mutex_lock(&EXT4_SB(sb)->s_resize_lock); 1030 mutex_lock(&EXT4_SB(sb)->s_resize_lock);
1055 if (o_blocks_count != ext4_blocks_count(es)) { 1031 if (o_blocks_count != ext4_blocks_count(es)) {
1056 ext4_warning(sb, __func__, 1032 ext4_warning(sb, "multiple resizers run on filesystem!");
1057 "multiple resizers run on filesystem!");
1058 mutex_unlock(&EXT4_SB(sb)->s_resize_lock); 1033 mutex_unlock(&EXT4_SB(sb)->s_resize_lock);
1059 ext4_journal_stop(handle); 1034 ext4_journal_stop(handle);
1060 err = -EBUSY; 1035 err = -EBUSY;
@@ -1063,8 +1038,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
1063 1038
1064 if ((err = ext4_journal_get_write_access(handle, 1039 if ((err = ext4_journal_get_write_access(handle,
1065 EXT4_SB(sb)->s_sbh))) { 1040 EXT4_SB(sb)->s_sbh))) {
1066 ext4_warning(sb, __func__, 1041 ext4_warning(sb, "error %d on journal write access", err);
1067 "error %d on journal write access", err);
1068 mutex_unlock(&EXT4_SB(sb)->s_resize_lock); 1042 mutex_unlock(&EXT4_SB(sb)->s_resize_lock);
1069 ext4_journal_stop(handle); 1043 ext4_journal_stop(handle);
1070 goto exit_put; 1044 goto exit_put;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 68a55dffb360..1c85bb67e6eb 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -333,7 +333,7 @@ static void ext4_handle_error(struct super_block *sb)
333 sb->s_id); 333 sb->s_id);
334} 334}
335 335
336void ext4_error(struct super_block *sb, const char *function, 336void __ext4_error(struct super_block *sb, const char *function,
337 const char *fmt, ...) 337 const char *fmt, ...)
338{ 338{
339 va_list args; 339 va_list args;
@@ -450,7 +450,7 @@ void ext4_msg (struct super_block * sb, const char *prefix,
450 va_end(args); 450 va_end(args);
451} 451}
452 452
453void ext4_warning(struct super_block *sb, const char *function, 453void __ext4_warning(struct super_block *sb, const char *function,
454 const char *fmt, ...) 454 const char *fmt, ...)
455{ 455{
456 va_list args; 456 va_list args;
@@ -507,7 +507,7 @@ void ext4_update_dynamic_rev(struct super_block *sb)
507 if (le32_to_cpu(es->s_rev_level) > EXT4_GOOD_OLD_REV) 507 if (le32_to_cpu(es->s_rev_level) > EXT4_GOOD_OLD_REV)
508 return; 508 return;
509 509
510 ext4_warning(sb, __func__, 510 ext4_warning(sb,
511 "updating to rev %d because of new feature flag, " 511 "updating to rev %d because of new feature flag, "
512 "running e2fsck is recommended", 512 "running e2fsck is recommended",
513 EXT4_DYNAMIC_REV); 513 EXT4_DYNAMIC_REV);
@@ -3367,10 +3367,9 @@ static void ext4_clear_journal_err(struct super_block *sb,
3367 char nbuf[16]; 3367 char nbuf[16];
3368 3368
3369 errstr = ext4_decode_error(sb, j_errno, nbuf); 3369 errstr = ext4_decode_error(sb, j_errno, nbuf);
3370 ext4_warning(sb, __func__, "Filesystem error recorded " 3370 ext4_warning(sb, "Filesystem error recorded "
3371 "from previous mount: %s", errstr); 3371 "from previous mount: %s", errstr);
3372 ext4_warning(sb, __func__, "Marking fs in need of " 3372 ext4_warning(sb, "Marking fs in need of filesystem check.");
3373 "filesystem check.");
3374 3373
3375 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; 3374 EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
3376 es->s_state |= cpu_to_le16(EXT4_ERROR_FS); 3375 es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index c619a7ea670d..627c98abbed9 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -227,7 +227,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
227 ea_bdebug(bh, "b_count=%d, refcount=%d", 227 ea_bdebug(bh, "b_count=%d, refcount=%d",
228 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); 228 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
229 if (ext4_xattr_check_block(bh)) { 229 if (ext4_xattr_check_block(bh)) {
230bad_block: ext4_error(inode->i_sb, __func__, 230bad_block:
231 ext4_error(inode->i_sb,
231 "inode %lu: bad block %llu", inode->i_ino, 232 "inode %lu: bad block %llu", inode->i_ino,
232 EXT4_I(inode)->i_file_acl); 233 EXT4_I(inode)->i_file_acl);
233 error = -EIO; 234 error = -EIO;
@@ -371,7 +372,7 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size)
371 ea_bdebug(bh, "b_count=%d, refcount=%d", 372 ea_bdebug(bh, "b_count=%d, refcount=%d",
372 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); 373 atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
373 if (ext4_xattr_check_block(bh)) { 374 if (ext4_xattr_check_block(bh)) {
374 ext4_error(inode->i_sb, __func__, 375 ext4_error(inode->i_sb,
375 "inode %lu: bad block %llu", inode->i_ino, 376 "inode %lu: bad block %llu", inode->i_ino,
376 EXT4_I(inode)->i_file_acl); 377 EXT4_I(inode)->i_file_acl);
377 error = -EIO; 378 error = -EIO;
@@ -665,9 +666,8 @@ ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i,
665 atomic_read(&(bs->bh->b_count)), 666 atomic_read(&(bs->bh->b_count)),
666 le32_to_cpu(BHDR(bs->bh)->h_refcount)); 667 le32_to_cpu(BHDR(bs->bh)->h_refcount));
667 if (ext4_xattr_check_block(bs->bh)) { 668 if (ext4_xattr_check_block(bs->bh)) {
668 ext4_error(sb, __func__, 669 ext4_error(sb, "inode %lu: bad block %llu",
669 "inode %lu: bad block %llu", inode->i_ino, 670 inode->i_ino, EXT4_I(inode)->i_file_acl);
670 EXT4_I(inode)->i_file_acl);
671 error = -EIO; 671 error = -EIO;
672 goto cleanup; 672 goto cleanup;
673 } 673 }
@@ -880,9 +880,8 @@ cleanup_dquot:
880 goto cleanup; 880 goto cleanup;
881 881
882bad_block: 882bad_block:
883 ext4_error(inode->i_sb, __func__, 883 ext4_error(inode->i_sb, "inode %lu: bad block %llu",
884 "inode %lu: bad block %llu", inode->i_ino, 884 inode->i_ino, EXT4_I(inode)->i_file_acl);
885 EXT4_I(inode)->i_file_acl);
886 goto cleanup; 885 goto cleanup;
887 886
888#undef header 887#undef header
@@ -1195,9 +1194,8 @@ retry:
1195 if (!bh) 1194 if (!bh)
1196 goto cleanup; 1195 goto cleanup;
1197 if (ext4_xattr_check_block(bh)) { 1196 if (ext4_xattr_check_block(bh)) {
1198 ext4_error(inode->i_sb, __func__, 1197 ext4_error(inode->i_sb, "inode %lu: bad block %llu",
1199 "inode %lu: bad block %llu", inode->i_ino, 1198 inode->i_ino, EXT4_I(inode)->i_file_acl);
1200 EXT4_I(inode)->i_file_acl);
1201 error = -EIO; 1199 error = -EIO;
1202 goto cleanup; 1200 goto cleanup;
1203 } 1201 }
@@ -1372,16 +1370,14 @@ ext4_xattr_delete_inode(handle_t *handle, struct inode *inode)
1372 goto cleanup; 1370 goto cleanup;
1373 bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); 1371 bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
1374 if (!bh) { 1372 if (!bh) {
1375 ext4_error(inode->i_sb, __func__, 1373 ext4_error(inode->i_sb, "inode %lu: block %llu read error",
1376 "inode %lu: block %llu read error", inode->i_ino, 1374 inode->i_ino, EXT4_I(inode)->i_file_acl);
1377 EXT4_I(inode)->i_file_acl);
1378 goto cleanup; 1375 goto cleanup;
1379 } 1376 }
1380 if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || 1377 if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) ||
1381 BHDR(bh)->h_blocks != cpu_to_le32(1)) { 1378 BHDR(bh)->h_blocks != cpu_to_le32(1)) {
1382 ext4_error(inode->i_sb, __func__, 1379 ext4_error(inode->i_sb, "inode %lu: bad block %llu",
1383 "inode %lu: bad block %llu", inode->i_ino, 1380 inode->i_ino, EXT4_I(inode)->i_file_acl);
1384 EXT4_I(inode)->i_file_acl);
1385 goto cleanup; 1381 goto cleanup;
1386 } 1382 }
1387 ext4_xattr_release_block(handle, inode, bh); 1383 ext4_xattr_release_block(handle, inode, bh);
@@ -1506,7 +1502,7 @@ again:
1506 } 1502 }
1507 bh = sb_bread(inode->i_sb, ce->e_block); 1503 bh = sb_bread(inode->i_sb, ce->e_block);
1508 if (!bh) { 1504 if (!bh) {
1509 ext4_error(inode->i_sb, __func__, 1505 ext4_error(inode->i_sb,
1510 "inode %lu: block %lu read error", 1506 "inode %lu: block %lu read error",
1511 inode->i_ino, (unsigned long) ce->e_block); 1507 inode->i_ino, (unsigned long) ce->e_block);
1512 } else if (le32_to_cpu(BHDR(bh)->h_refcount) >= 1508 } else if (le32_to_cpu(BHDR(bh)->h_refcount) >=