diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-05-16 21:00:00 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-05-16 21:00:00 -0400 |
commit | 24676da469f50f433baa347845639662c561d1f6 (patch) | |
tree | b4b8205f8b50376af286193d0dcbe76f2bc2d1e1 /fs/ext4/dir.c | |
parent | 2ed886852adfcb070bf350e66a0da0d98b2f3ab5 (diff) |
ext4: Convert calls of ext4_error() to EXT4_ERROR_INODE()
EXT4_ERROR_INODE() tends to provide better error information and in a
more consistent format. Some errors were not even identifying the inode
or directory which was corrupted, which made them not very useful.
Addresses-Google-Bug: #2507977
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/dir.c')
-rw-r--r-- | fs/ext4/dir.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index e3f2700b8be7..6a2b8bcff641 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -83,11 +83,10 @@ 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_inode(function, dir, |
87 | "bad entry in directory #%lu: %s - block=%llu" | 87 | "bad entry in directory: %s - block=%llu" |
88 | "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", | 88 | "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", |
89 | dir->i_ino, error_msg, | 89 | error_msg, (unsigned long long) bh->b_blocknr, |
90 | (unsigned long long) bh->b_blocknr, | ||
91 | (unsigned) (offset%bh->b_size), offset, | 90 | (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); |
@@ -152,9 +151,8 @@ static int ext4_readdir(struct file *filp, | |||
152 | */ | 151 | */ |
153 | if (!bh) { | 152 | if (!bh) { |
154 | if (!dir_has_error) { | 153 | if (!dir_has_error) { |
155 | ext4_error(sb, "directory #%lu " | 154 | EXT4_ERROR_INODE(inode, "directory " |
156 | "contains a hole at offset %Lu", | 155 | "contains a hole at offset %Lu", |
157 | inode->i_ino, | ||
158 | (unsigned long long) filp->f_pos); | 156 | (unsigned long long) filp->f_pos); |
159 | dir_has_error = 1; | 157 | dir_has_error = 1; |
160 | } | 158 | } |