@@ -337,7 +337,8 @@ static int ext4_block_to_path(struct inode *inode,
337337 return n ;
338338}
339339
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 ,
341342 __le32 * p , unsigned int max )
342343{
343344 __le32 * bref = p ;
@@ -348,8 +349,8 @@ static int __ext4_check_blockref(const char *function, struct inode *inode,
348349 if (blk &&
349350 unlikely (!ext4_data_block_valid (EXT4_SB (inode -> i_sb ),
350351 blk , 1 ))) {
351- ext4_error_inode (function , inode ,
352- "invalid block reference %u" , blk );
352+ ext4_error_inode (inode , function , line , blk ,
353+ "invalid block" );
353354 return - EIO ;
354355 }
355356 }
@@ -358,11 +359,13 @@ static int __ext4_check_blockref(const char *function, struct inode *inode,
358359
359360
360361#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, \
362364 EXT4_ADDR_PER_BLOCK((inode)->i_sb))
363365
364366#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, \
366369 EXT4_NDIR_BLOCKS)
367370
368371/**
@@ -1129,21 +1132,22 @@ void ext4_da_update_reserve_space(struct inode *inode,
11291132}
11301133
11311134static 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 )
11331137{
11341138 if (!ext4_data_block_valid (EXT4_SB (inode -> i_sb ), map -> m_pblk ,
11351139 map -> m_len )) {
1136- ext4_error_inode (func , inode ,
1137- "lblock %lu mapped to illegal pblock %llu "
1138- "(length %d)" , (unsigned long ) map -> m_lblk ,
1139- map -> m_pblk , map -> m_len );
1140+ ext4_error_inode (inode , func , line , map -> m_pblk ,
1141+ "lblock %lu mapped to illegal pblock "
1142+ "(length %d)" , (unsigned long ) map -> m_lblk ,
1143+ map -> m_len );
11401144 return - EIO ;
11411145 }
11421146 return 0 ;
11431147}
11441148
11451149#define check_block_validity (inode , map ) \
1146- __check_block_validity((inode), __func__, (map))
1150+ __check_block_validity((inode), __func__, __LINE__, (map))
11471151
11481152/*
11491153 * 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,
44714475 * (should be rare).
44724476 */
44734477 if (!bh ) {
4474- EXT4_ERROR_INODE (inode ,
4475- "Read failure block=%llu" ,
4476- (unsigned long long ) nr );
4478+ EXT4_ERROR_INODE_BLOCK (inode , nr ,
4479+ "Read failure" );
44774480 continue ;
44784481 }
44794482
@@ -4788,8 +4791,8 @@ static int __ext4_get_inode_loc(struct inode *inode,
47884791
47894792 bh = sb_getblk (sb , block );
47904793 if (!bh ) {
4791- EXT4_ERROR_INODE (inode , "unable to read inode block - "
4792- "block %llu" , block );
4794+ EXT4_ERROR_INODE_BLOCK (inode , block ,
4795+ "unable to read itable block" );
47934796 return - EIO ;
47944797 }
47954798 if (!buffer_uptodate (bh )) {
@@ -4887,8 +4890,8 @@ static int __ext4_get_inode_loc(struct inode *inode,
48874890 submit_bh (READ_META , bh );
48884891 wait_on_buffer (bh );
48894892 if (!buffer_uptodate (bh )) {
4890- EXT4_ERROR_INODE (inode , "unable to read inode "
4891- "block %llu" , block );
4893+ EXT4_ERROR_INODE_BLOCK (inode , block ,
4894+ "unable to read itable block" );
48924895 brelse (bh );
48934896 return - EIO ;
48944897 }
@@ -5389,9 +5392,8 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc)
53895392 if (wbc -> sync_mode == WB_SYNC_ALL )
53905393 sync_dirty_buffer (iloc .bh );
53915394 if (buffer_req (iloc .bh ) && !buffer_uptodate (iloc .bh )) {
5392- EXT4_ERROR_INODE (inode ,
5393- "IO error syncing inode (block=%llu)" ,
5394- (unsigned long long ) iloc .bh -> b_blocknr );
5395+ EXT4_ERROR_INODE_BLOCK (inode , iloc .bh -> b_blocknr ,
5396+ "IO error syncing inode" );
53955397 err = - EIO ;
53965398 }
53975399 brelse (iloc .bh );
0 commit comments