ext4: Save error information to the superblock for analysis
Save number of file system errors, and the time function name, line number, block number, and inode number of the first and most recent errors reported on the file system in the superblock. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
@ -341,6 +341,7 @@ static int __ext4_check_blockref(const char *function, unsigned int line,
|
||||
struct inode *inode,
|
||||
__le32 *p, unsigned int max)
|
||||
{
|
||||
struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es;
|
||||
__le32 *bref = p;
|
||||
unsigned int blk;
|
||||
|
||||
@ -349,6 +350,7 @@ static int __ext4_check_blockref(const char *function, unsigned int line,
|
||||
if (blk &&
|
||||
unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb),
|
||||
blk, 1))) {
|
||||
es->s_last_error_block = cpu_to_le64(blk);
|
||||
ext4_error_inode(inode, function, line, blk,
|
||||
"invalid block");
|
||||
return -EIO;
|
||||
|
Reference in New Issue
Block a user