diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-07-27 11:56:40 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-07-27 11:56:40 -0400 |
commit | c398eda0e43a791be0fca6f197a1e2bbb9f16070 (patch) | |
tree | d7b2b95490f96a75e116a3aa13c17767aa630342 | |
parent | 60fd4da34d55a9cc0d857fc76dc12cf8cab4ed02 (diff) |
ext4: Pass line numbers to ext4_error() and friends
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/ext4/dir.c | 7 | ||||
-rw-r--r-- | fs/ext4/ext4.h | 44 | ||||
-rw-r--r-- | fs/ext4/ext4_jbd2.c | 12 | ||||
-rw-r--r-- | fs/ext4/ext4_jbd2.h | 4 | ||||
-rw-r--r-- | fs/ext4/extents.c | 10 | ||||
-rw-r--r-- | fs/ext4/inode.c | 44 | ||||
-rw-r--r-- | fs/ext4/move_extent.c | 10 | ||||
-rw-r--r-- | fs/ext4/super.c | 47 |
8 files changed, 98 insertions, 80 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index af581f08fe3a..62e8af04ed1e 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -84,11 +84,10 @@ int __ext4_check_dir_entry(const char *function, unsigned int line, | |||
84 | error_msg = "inode out of bounds"; | 84 | error_msg = "inode out of bounds"; |
85 | 85 | ||
86 | if (error_msg != NULL) | 86 | if (error_msg != NULL) |
87 | ext4_error_inode(function, dir, | 87 | ext4_error_inode(dir, function, line, bh->b_blocknr, |
88 | "bad entry in directory: %s - block=%llu" | 88 | "bad entry in directory: %s - " |
89 | "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", | 89 | "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", |
90 | error_msg, (unsigned long long) bh->b_blocknr, | 90 | error_msg, (unsigned) (offset%bh->b_size), offset, |
91 | (unsigned) (offset%bh->b_size), offset, | ||
92 | le32_to_cpu(de->inode), | 91 | le32_to_cpu(de->inode), |
93 | rlen, de->name_len); | 92 | rlen, de->name_len); |
94 | return error_msg == NULL ? 1 : 0; | 93 | return error_msg == NULL ? 1 : 0; |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 73465b26976d..088938148f5c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -57,10 +57,13 @@ | |||
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #define EXT4_ERROR_INODE(inode, fmt, a...) \ | 59 | #define EXT4_ERROR_INODE(inode, fmt, a...) \ |
60 | ext4_error_inode(__func__, (inode), (fmt), ## a) | 60 | ext4_error_inode((inode), __func__, __LINE__, 0, (fmt), ## a) |
61 | |||
62 | #define EXT4_ERROR_INODE_BLOCK(inode, block, fmt, a...) \ | ||
63 | ext4_error_inode((inode), __func__, __LINE__, (block), (fmt), ## a) | ||
61 | 64 | ||
62 | #define EXT4_ERROR_FILE(file, fmt, a...) \ | 65 | #define EXT4_ERROR_FILE(file, fmt, a...) \ |
63 | ext4_error_file(__func__, (file), (fmt), ## a) | 66 | ext4_error_file(__func__, __LINE__, (file), (fmt), ## a) |
64 | 67 | ||
65 | /* data type for block offset of block group */ | 68 | /* data type for block offset of block group */ |
66 | typedef int ext4_grpblk_t; | 69 | typedef int ext4_grpblk_t; |
@@ -1623,22 +1626,29 @@ extern int ext4_group_extend(struct super_block *sb, | |||
1623 | ext4_fsblk_t n_blocks_count); | 1626 | ext4_fsblk_t n_blocks_count); |
1624 | 1627 | ||
1625 | /* super.c */ | 1628 | /* super.c */ |
1626 | extern void __ext4_error(struct super_block *, const char *, const char *, ...) | 1629 | extern void __ext4_error(struct super_block *, const char *, unsigned int, |
1627 | __attribute__ ((format (printf, 3, 4))); | 1630 | const char *, ...) |
1628 | #define ext4_error(sb, message...) __ext4_error(sb, __func__, ## message) | 1631 | __attribute__ ((format (printf, 4, 5))); |
1629 | extern void ext4_error_inode(const char *, struct inode *, const char *, ...) | 1632 | #define ext4_error(sb, message...) __ext4_error(sb, __func__, \ |
1630 | __attribute__ ((format (printf, 3, 4))); | 1633 | __LINE__, ## message) |
1631 | extern void ext4_error_file(const char *, struct file *, const char *, ...) | 1634 | extern void ext4_error_inode(struct inode *, const char *, unsigned int, |
1632 | __attribute__ ((format (printf, 3, 4))); | 1635 | ext4_fsblk_t, const char *, ...) |
1633 | extern void __ext4_std_error(struct super_block *, const char *, int); | 1636 | __attribute__ ((format (printf, 5, 6))); |
1634 | extern void __ext4_abort(struct super_block *, const char *, const char *, ...) | 1637 | extern void ext4_error_file(struct file *, const char *, unsigned int, |
1635 | __attribute__ ((format (printf, 3, 4))); | 1638 | const char *, ...) |
1639 | __attribute__ ((format (printf, 4, 5))); | ||
1640 | extern void __ext4_std_error(struct super_block *, const char *, | ||
1641 | unsigned int, int); | ||
1642 | extern void __ext4_abort(struct super_block *, const char *, unsigned int, | ||
1643 | const char *, ...) | ||
1644 | __attribute__ ((format (printf, 4, 5))); | ||
1636 | #define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \ | 1645 | #define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \ |
1637 | ## message) | 1646 | __LINE__, ## message) |
1638 | extern void __ext4_warning(struct super_block *, const char *, | 1647 | extern void __ext4_warning(struct super_block *, const char *, unsigned int, |
1639 | const char *, ...) | 1648 | const char *, ...) |
1640 | __attribute__ ((format (printf, 3, 4))); | 1649 | __attribute__ ((format (printf, 4, 5))); |
1641 | #define ext4_warning(sb, message...) __ext4_warning(sb, __func__, ## message) | 1650 | #define ext4_warning(sb, message...) __ext4_warning(sb, __func__, \ |
1651 | __LINE__, ## message) | ||
1642 | extern void ext4_msg(struct super_block *, const char *, const char *, ...) | 1652 | extern void ext4_msg(struct super_block *, const char *, const char *, ...) |
1643 | __attribute__ ((format (printf, 3, 4))); | 1653 | __attribute__ ((format (printf, 3, 4))); |
1644 | extern void __ext4_grp_locked_error(const char *, unsigned int, \ | 1654 | extern void __ext4_grp_locked_error(const char *, unsigned int, \ |
@@ -1781,7 +1791,7 @@ static inline unsigned int ext4_flex_bg_size(struct ext4_sb_info *sbi) | |||
1781 | #define ext4_std_error(sb, errno) \ | 1791 | #define ext4_std_error(sb, errno) \ |
1782 | do { \ | 1792 | do { \ |
1783 | if ((errno)) \ | 1793 | if ((errno)) \ |
1784 | __ext4_std_error((sb), __func__, (errno)); \ | 1794 | __ext4_std_error((sb), __func__, __LINE__, (errno)); \ |
1785 | } while (0) | 1795 | } while (0) |
1786 | 1796 | ||
1787 | #ifdef CONFIG_SMP | 1797 | #ifdef CONFIG_SMP |
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c index 9de37b9e177a..23425cd68daa 100644 --- a/fs/ext4/ext4_jbd2.c +++ b/fs/ext4/ext4_jbd2.c | |||
@@ -94,8 +94,8 @@ int __ext4_forget(const char *where, unsigned int line, handle_t *handle, | |||
94 | if (err) { | 94 | if (err) { |
95 | ext4_journal_abort_handle(where, line, __func__, | 95 | ext4_journal_abort_handle(where, line, __func__, |
96 | bh, handle, err); | 96 | bh, handle, err); |
97 | __ext4_abort(inode->i_sb, where, | 97 | __ext4_abort(inode->i_sb, where, line, |
98 | "error %d when attempting revoke", err); | 98 | "error %d when attempting revoke", err); |
99 | } | 99 | } |
100 | BUFFER_TRACE(bh, "exit"); | 100 | BUFFER_TRACE(bh, "exit"); |
101 | return err; | 101 | return err; |
@@ -134,11 +134,9 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, | |||
134 | if (inode && inode_needs_sync(inode)) { | 134 | if (inode && inode_needs_sync(inode)) { |
135 | sync_dirty_buffer(bh); | 135 | sync_dirty_buffer(bh); |
136 | if (buffer_req(bh) && !buffer_uptodate(bh)) { | 136 | if (buffer_req(bh) && !buffer_uptodate(bh)) { |
137 | ext4_error(inode->i_sb, | 137 | ext4_error_inode(inode, where, line, |
138 | "IO error syncing inode, " | 138 | bh->b_blocknr, |
139 | "inode=%lu, block=%llu", | 139 | "IO error syncing itable block"); |
140 | inode->i_ino, | ||
141 | (unsigned long long) bh->b_blocknr); | ||
142 | err = -EIO; | 140 | err = -EIO; |
143 | } | 141 | } |
144 | } | 142 | } |
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h index 6883c6be5b8d..b0bd792c58c5 100644 --- a/fs/ext4/ext4_jbd2.h +++ b/fs/ext4/ext4_jbd2.h | |||
@@ -162,7 +162,7 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line, | |||
162 | __ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb)) | 162 | __ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb)) |
163 | 163 | ||
164 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks); | 164 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks); |
165 | int __ext4_journal_stop(const char *where, handle_t *handle); | 165 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle); |
166 | 166 | ||
167 | #define EXT4_NOJOURNAL_MAX_REF_COUNT ((unsigned long) 4096) | 167 | #define EXT4_NOJOURNAL_MAX_REF_COUNT ((unsigned long) 4096) |
168 | 168 | ||
@@ -215,7 +215,7 @@ static inline handle_t *ext4_journal_start(struct inode *inode, int nblocks) | |||
215 | } | 215 | } |
216 | 216 | ||
217 | #define ext4_journal_stop(handle) \ | 217 | #define ext4_journal_stop(handle) \ |
218 | __ext4_journal_stop(__func__, (handle)) | 218 | __ext4_journal_stop(__func__, __LINE__, (handle)) |
219 | 219 | ||
220 | static inline handle_t *ext4_journal_current_handle(void) | 220 | static inline handle_t *ext4_journal_current_handle(void) |
221 | { | 221 | { |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 346de3daab79..2c01d7391f1e 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -401,9 +401,9 @@ static int ext4_valid_extent_entries(struct inode *inode, | |||
401 | return 1; | 401 | return 1; |
402 | } | 402 | } |
403 | 403 | ||
404 | static int __ext4_ext_check(const char *function, struct inode *inode, | 404 | static int __ext4_ext_check(const char *function, unsigned int line, |
405 | struct ext4_extent_header *eh, | 405 | struct inode *inode, struct ext4_extent_header *eh, |
406 | int depth) | 406 | int depth) |
407 | { | 407 | { |
408 | const char *error_msg; | 408 | const char *error_msg; |
409 | int max = 0; | 409 | int max = 0; |
@@ -436,7 +436,7 @@ static int __ext4_ext_check(const char *function, struct inode *inode, | |||
436 | return 0; | 436 | return 0; |
437 | 437 | ||
438 | corrupted: | 438 | corrupted: |
439 | ext4_error_inode(function, inode, | 439 | ext4_error_inode(inode, function, line, 0, |
440 | "bad header/extent: %s - magic %x, " | 440 | "bad header/extent: %s - magic %x, " |
441 | "entries %u, max %u(%u), depth %u(%u)", | 441 | "entries %u, max %u(%u), depth %u(%u)", |
442 | error_msg, le16_to_cpu(eh->eh_magic), | 442 | error_msg, le16_to_cpu(eh->eh_magic), |
@@ -447,7 +447,7 @@ corrupted: | |||
447 | } | 447 | } |
448 | 448 | ||
449 | #define ext4_ext_check(inode, eh, depth) \ | 449 | #define ext4_ext_check(inode, eh, depth) \ |
450 | __ext4_ext_check(__func__, inode, eh, depth) | 450 | __ext4_ext_check(__func__, __LINE__, inode, eh, depth) |
451 | 451 | ||
452 | int ext4_ext_check_inode(struct inode *inode) | 452 | int ext4_ext_check_inode(struct inode *inode) |
453 | { | 453 | { |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 64baadb4956d..69ea663ef03e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -337,7 +337,8 @@ static int ext4_block_to_path(struct inode *inode, | |||
337 | return n; | 337 | return n; |
338 | } | 338 | } |
339 | 339 | ||
340 | static int __ext4_check_blockref(const char *function, struct inode *inode, | 340 | static int __ext4_check_blockref(const char *function, unsigned int line, |
341 | struct inode *inode, | ||
341 | __le32 *p, unsigned int max) | 342 | __le32 *p, unsigned int max) |
342 | { | 343 | { |
343 | __le32 *bref = p; | 344 | __le32 *bref = p; |
@@ -348,8 +349,8 @@ static int __ext4_check_blockref(const char *function, struct inode *inode, | |||
348 | if (blk && | 349 | if (blk && |
349 | unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb), | 350 | unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb), |
350 | blk, 1))) { | 351 | blk, 1))) { |
351 | ext4_error_inode(function, inode, | 352 | ext4_error_inode(inode, function, line, blk, |
352 | "invalid block reference %u", blk); | 353 | "invalid block"); |
353 | return -EIO; | 354 | return -EIO; |
354 | } | 355 | } |
355 | } | 356 | } |
@@ -358,11 +359,13 @@ static int __ext4_check_blockref(const char *function, struct inode *inode, | |||
358 | 359 | ||
359 | 360 | ||
360 | #define ext4_check_indirect_blockref(inode, bh) \ | 361 | #define ext4_check_indirect_blockref(inode, bh) \ |
361 | __ext4_check_blockref(__func__, inode, (__le32 *)(bh)->b_data, \ | 362 | __ext4_check_blockref(__func__, __LINE__, inode, \ |
363 | (__le32 *)(bh)->b_data, \ | ||
362 | EXT4_ADDR_PER_BLOCK((inode)->i_sb)) | 364 | EXT4_ADDR_PER_BLOCK((inode)->i_sb)) |
363 | 365 | ||
364 | #define ext4_check_inode_blockref(inode) \ | 366 | #define ext4_check_inode_blockref(inode) \ |
365 | __ext4_check_blockref(__func__, inode, EXT4_I(inode)->i_data, \ | 367 | __ext4_check_blockref(__func__, __LINE__, inode, \ |
368 | EXT4_I(inode)->i_data, \ | ||
366 | EXT4_NDIR_BLOCKS) | 369 | EXT4_NDIR_BLOCKS) |
367 | 370 | ||
368 | /** | 371 | /** |
@@ -1129,21 +1132,22 @@ void ext4_da_update_reserve_space(struct inode *inode, | |||
1129 | } | 1132 | } |
1130 | 1133 | ||
1131 | static int __check_block_validity(struct inode *inode, const char *func, | 1134 | static int __check_block_validity(struct inode *inode, const char *func, |
1132 | struct ext4_map_blocks *map) | 1135 | unsigned int line, |
1136 | struct ext4_map_blocks *map) | ||
1133 | { | 1137 | { |
1134 | if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, | 1138 | if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, |
1135 | map->m_len)) { | 1139 | map->m_len)) { |
1136 | ext4_error_inode(func, inode, | 1140 | ext4_error_inode(inode, func, line, map->m_pblk, |
1137 | "lblock %lu mapped to illegal pblock %llu " | 1141 | "lblock %lu mapped to illegal pblock " |
1138 | "(length %d)", (unsigned long) map->m_lblk, | 1142 | "(length %d)", (unsigned long) map->m_lblk, |
1139 | map->m_pblk, map->m_len); | 1143 | map->m_len); |
1140 | return -EIO; | 1144 | return -EIO; |
1141 | } | 1145 | } |
1142 | return 0; | 1146 | return 0; |
1143 | } | 1147 | } |
1144 | 1148 | ||
1145 | #define check_block_validity(inode, map) \ | 1149 | #define check_block_validity(inode, map) \ |
1146 | __check_block_validity((inode), __func__, (map)) | 1150 | __check_block_validity((inode), __func__, __LINE__, (map)) |
1147 | 1151 | ||
1148 | /* | 1152 | /* |
1149 | * Return the number of contiguous dirty pages in a given inode | 1153 | * Return the number of contiguous dirty pages in a given inode |
@@ -4471,9 +4475,8 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode, | |||
4471 | * (should be rare). | 4475 | * (should be rare). |
4472 | */ | 4476 | */ |
4473 | if (!bh) { | 4477 | if (!bh) { |
4474 | EXT4_ERROR_INODE(inode, | 4478 | EXT4_ERROR_INODE_BLOCK(inode, nr, |
4475 | "Read failure block=%llu", | 4479 | "Read failure"); |
4476 | (unsigned long long) nr); | ||
4477 | continue; | 4480 | continue; |
4478 | } | 4481 | } |
4479 | 4482 | ||
@@ -4788,8 +4791,8 @@ static int __ext4_get_inode_loc(struct inode *inode, | |||
4788 | 4791 | ||
4789 | bh = sb_getblk(sb, block); | 4792 | bh = sb_getblk(sb, block); |
4790 | if (!bh) { | 4793 | if (!bh) { |
4791 | EXT4_ERROR_INODE(inode, "unable to read inode block - " | 4794 | EXT4_ERROR_INODE_BLOCK(inode, block, |
4792 | "block %llu", block); | 4795 | "unable to read itable block"); |
4793 | return -EIO; | 4796 | return -EIO; |
4794 | } | 4797 | } |
4795 | if (!buffer_uptodate(bh)) { | 4798 | if (!buffer_uptodate(bh)) { |
@@ -4887,8 +4890,8 @@ make_io: | |||
4887 | submit_bh(READ_META, bh); | 4890 | submit_bh(READ_META, bh); |
4888 | wait_on_buffer(bh); | 4891 | wait_on_buffer(bh); |
4889 | if (!buffer_uptodate(bh)) { | 4892 | if (!buffer_uptodate(bh)) { |
4890 | EXT4_ERROR_INODE(inode, "unable to read inode " | 4893 | EXT4_ERROR_INODE_BLOCK(inode, block, |
4891 | "block %llu", block); | 4894 | "unable to read itable block"); |
4892 | brelse(bh); | 4895 | brelse(bh); |
4893 | return -EIO; | 4896 | return -EIO; |
4894 | } | 4897 | } |
@@ -5389,9 +5392,8 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
5389 | if (wbc->sync_mode == WB_SYNC_ALL) | 5392 | if (wbc->sync_mode == WB_SYNC_ALL) |
5390 | sync_dirty_buffer(iloc.bh); | 5393 | sync_dirty_buffer(iloc.bh); |
5391 | if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) { | 5394 | if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) { |
5392 | EXT4_ERROR_INODE(inode, | 5395 | EXT4_ERROR_INODE_BLOCK(inode, iloc.bh->b_blocknr, |
5393 | "IO error syncing inode (block=%llu)", | 5396 | "IO error syncing inode"); |
5394 | (unsigned long long) iloc.bh->b_blocknr); | ||
5395 | err = -EIO; | 5397 | err = -EIO; |
5396 | } | 5398 | } |
5397 | brelse(iloc.bh); | 5399 | brelse(iloc.bh); |
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 52abfa12762a..5f1ed9fc913c 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
@@ -148,17 +148,17 @@ mext_next_extent(struct inode *inode, struct ext4_ext_path *path, | |||
148 | */ | 148 | */ |
149 | static int | 149 | static int |
150 | mext_check_null_inode(struct inode *inode1, struct inode *inode2, | 150 | mext_check_null_inode(struct inode *inode1, struct inode *inode2, |
151 | const char *function) | 151 | const char *function, unsigned int line) |
152 | { | 152 | { |
153 | int ret = 0; | 153 | int ret = 0; |
154 | 154 | ||
155 | if (inode1 == NULL) { | 155 | if (inode1 == NULL) { |
156 | __ext4_error(inode2->i_sb, function, | 156 | __ext4_error(inode2->i_sb, function, line, |
157 | "Both inodes should not be NULL: " | 157 | "Both inodes should not be NULL: " |
158 | "inode1 NULL inode2 %lu", inode2->i_ino); | 158 | "inode1 NULL inode2 %lu", inode2->i_ino); |
159 | ret = -EIO; | 159 | ret = -EIO; |
160 | } else if (inode2 == NULL) { | 160 | } else if (inode2 == NULL) { |
161 | __ext4_error(inode1->i_sb, function, | 161 | __ext4_error(inode1->i_sb, function, line, |
162 | "Both inodes should not be NULL: " | 162 | "Both inodes should not be NULL: " |
163 | "inode1 %lu inode2 NULL", inode1->i_ino); | 163 | "inode1 %lu inode2 NULL", inode1->i_ino); |
164 | ret = -EIO; | 164 | ret = -EIO; |
@@ -1084,7 +1084,7 @@ mext_inode_double_lock(struct inode *inode1, struct inode *inode2) | |||
1084 | 1084 | ||
1085 | BUG_ON(inode1 == NULL && inode2 == NULL); | 1085 | BUG_ON(inode1 == NULL && inode2 == NULL); |
1086 | 1086 | ||
1087 | ret = mext_check_null_inode(inode1, inode2, __func__); | 1087 | ret = mext_check_null_inode(inode1, inode2, __func__, __LINE__); |
1088 | if (ret < 0) | 1088 | if (ret < 0) |
1089 | goto out; | 1089 | goto out; |
1090 | 1090 | ||
@@ -1121,7 +1121,7 @@ mext_inode_double_unlock(struct inode *inode1, struct inode *inode2) | |||
1121 | 1121 | ||
1122 | BUG_ON(inode1 == NULL && inode2 == NULL); | 1122 | BUG_ON(inode1 == NULL && inode2 == NULL); |
1123 | 1123 | ||
1124 | ret = mext_check_null_inode(inode1, inode2, __func__); | 1124 | ret = mext_check_null_inode(inode1, inode2, __func__, __LINE__); |
1125 | if (ret < 0) | 1125 | if (ret < 0) |
1126 | goto out; | 1126 | goto out; |
1127 | 1127 | ||
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 87db5ecfccb4..bcf74b31d014 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -262,7 +262,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) | |||
262 | * that sync() will call the filesystem's write_super callback if | 262 | * that sync() will call the filesystem's write_super callback if |
263 | * appropriate. | 263 | * appropriate. |
264 | */ | 264 | */ |
265 | int __ext4_journal_stop(const char *where, handle_t *handle) | 265 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle) |
266 | { | 266 | { |
267 | struct super_block *sb; | 267 | struct super_block *sb; |
268 | int err; | 268 | int err; |
@@ -279,7 +279,7 @@ int __ext4_journal_stop(const char *where, handle_t *handle) | |||
279 | if (!err) | 279 | if (!err) |
280 | err = rc; | 280 | err = rc; |
281 | if (err) | 281 | if (err) |
282 | __ext4_std_error(sb, where, err); | 282 | __ext4_std_error(sb, where, line, err); |
283 | return err; | 283 | return err; |
284 | } | 284 | } |
285 | 285 | ||
@@ -350,12 +350,13 @@ static void ext4_handle_error(struct super_block *sb) | |||
350 | } | 350 | } |
351 | 351 | ||
352 | void __ext4_error(struct super_block *sb, const char *function, | 352 | void __ext4_error(struct super_block *sb, const char *function, |
353 | const char *fmt, ...) | 353 | unsigned int line, const char *fmt, ...) |
354 | { | 354 | { |
355 | va_list args; | 355 | va_list args; |
356 | 356 | ||
357 | va_start(args, fmt); | 357 | va_start(args, fmt); |
358 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function); | 358 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: comm %s: ", |
359 | sb->s_id, function, line, current->comm); | ||
359 | vprintk(fmt, args); | 360 | vprintk(fmt, args); |
360 | printk("\n"); | 361 | printk("\n"); |
361 | va_end(args); | 362 | va_end(args); |
@@ -363,14 +364,18 @@ void __ext4_error(struct super_block *sb, const char *function, | |||
363 | ext4_handle_error(sb); | 364 | ext4_handle_error(sb); |
364 | } | 365 | } |
365 | 366 | ||
366 | void ext4_error_inode(const char *function, struct inode *inode, | 367 | void ext4_error_inode(struct inode *inode, const char *function, |
368 | unsigned int line, ext4_fsblk_t block, | ||
367 | const char *fmt, ...) | 369 | const char *fmt, ...) |
368 | { | 370 | { |
369 | va_list args; | 371 | va_list args; |
370 | 372 | ||
371 | va_start(args, fmt); | 373 | va_start(args, fmt); |
372 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: inode #%lu: (comm %s) ", | 374 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: inode #%lu: ", |
373 | inode->i_sb->s_id, function, inode->i_ino, current->comm); | 375 | inode->i_sb->s_id, function, line, inode->i_ino); |
376 | if (block) | ||
377 | printk("block %llu: ", block); | ||
378 | printk("comm %s: ", current->comm); | ||
374 | vprintk(fmt, args); | 379 | vprintk(fmt, args); |
375 | printk("\n"); | 380 | printk("\n"); |
376 | va_end(args); | 381 | va_end(args); |
@@ -378,8 +383,8 @@ void ext4_error_inode(const char *function, struct inode *inode, | |||
378 | ext4_handle_error(inode->i_sb); | 383 | ext4_handle_error(inode->i_sb); |
379 | } | 384 | } |
380 | 385 | ||
381 | void ext4_error_file(const char *function, struct file *file, | 386 | void ext4_error_file(struct file *file, const char *function, |
382 | const char *fmt, ...) | 387 | unsigned int line, const char *fmt, ...) |
383 | { | 388 | { |
384 | va_list args; | 389 | va_list args; |
385 | struct inode *inode = file->f_dentry->d_inode; | 390 | struct inode *inode = file->f_dentry->d_inode; |
@@ -390,8 +395,10 @@ void ext4_error_file(const char *function, struct file *file, | |||
390 | if (!path) | 395 | if (!path) |
391 | path = "(unknown)"; | 396 | path = "(unknown)"; |
392 | printk(KERN_CRIT | 397 | printk(KERN_CRIT |
393 | "EXT4-fs error (device %s): %s: inode #%lu (comm %s path %s): ", | 398 | "EXT4-fs error (device %s): %s:%d: inode #%lu " |
394 | inode->i_sb->s_id, function, inode->i_ino, current->comm, path); | 399 | "(comm %s path %s): ", |
400 | inode->i_sb->s_id, function, line, inode->i_ino, | ||
401 | current->comm, path); | ||
395 | vprintk(fmt, args); | 402 | vprintk(fmt, args); |
396 | printk("\n"); | 403 | printk("\n"); |
397 | va_end(args); | 404 | va_end(args); |
@@ -436,7 +443,8 @@ static const char *ext4_decode_error(struct super_block *sb, int errno, | |||
436 | /* __ext4_std_error decodes expected errors from journaling functions | 443 | /* __ext4_std_error decodes expected errors from journaling functions |
437 | * automatically and invokes the appropriate error response. */ | 444 | * automatically and invokes the appropriate error response. */ |
438 | 445 | ||
439 | void __ext4_std_error(struct super_block *sb, const char *function, int errno) | 446 | void __ext4_std_error(struct super_block *sb, const char *function, |
447 | unsigned int line, int errno) | ||
440 | { | 448 | { |
441 | char nbuf[16]; | 449 | char nbuf[16]; |
442 | const char *errstr; | 450 | const char *errstr; |
@@ -449,8 +457,8 @@ void __ext4_std_error(struct super_block *sb, const char *function, int errno) | |||
449 | return; | 457 | return; |
450 | 458 | ||
451 | errstr = ext4_decode_error(sb, errno, nbuf); | 459 | errstr = ext4_decode_error(sb, errno, nbuf); |
452 | printk(KERN_CRIT "EXT4-fs error (device %s) in %s: %s\n", | 460 | printk(KERN_CRIT "EXT4-fs error (device %s) in %s:%d: %s\n", |
453 | sb->s_id, function, errstr); | 461 | sb->s_id, function, line, errstr); |
454 | 462 | ||
455 | ext4_handle_error(sb); | 463 | ext4_handle_error(sb); |
456 | } | 464 | } |
@@ -466,12 +474,13 @@ void __ext4_std_error(struct super_block *sb, const char *function, int errno) | |||
466 | */ | 474 | */ |
467 | 475 | ||
468 | void __ext4_abort(struct super_block *sb, const char *function, | 476 | void __ext4_abort(struct super_block *sb, const char *function, |
469 | const char *fmt, ...) | 477 | unsigned int line, const char *fmt, ...) |
470 | { | 478 | { |
471 | va_list args; | 479 | va_list args; |
472 | 480 | ||
473 | va_start(args, fmt); | 481 | va_start(args, fmt); |
474 | printk(KERN_CRIT "EXT4-fs error (device %s): %s: ", sb->s_id, function); | 482 | printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: ", sb->s_id, |
483 | function, line); | ||
475 | vprintk(fmt, args); | 484 | vprintk(fmt, args); |
476 | printk("\n"); | 485 | printk("\n"); |
477 | va_end(args); | 486 | va_end(args); |
@@ -503,13 +512,13 @@ void ext4_msg (struct super_block * sb, const char *prefix, | |||
503 | } | 512 | } |
504 | 513 | ||
505 | void __ext4_warning(struct super_block *sb, const char *function, | 514 | void __ext4_warning(struct super_block *sb, const char *function, |
506 | const char *fmt, ...) | 515 | unsigned int line, const char *fmt, ...) |
507 | { | 516 | { |
508 | va_list args; | 517 | va_list args; |
509 | 518 | ||
510 | va_start(args, fmt); | 519 | va_start(args, fmt); |
511 | printk(KERN_WARNING "EXT4-fs warning (device %s): %s: ", | 520 | printk(KERN_WARNING "EXT4-fs warning (device %s): %s:%d: ", |
512 | sb->s_id, function); | 521 | sb->s_id, function, line); |
513 | vprintk(fmt, args); | 522 | vprintk(fmt, args); |
514 | printk("\n"); | 523 | printk("\n"); |
515 | va_end(args); | 524 | va_end(args); |