Commit 24676da4 authored by Theodore Ts'o's avatar Theodore Ts'o

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: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 2ed88685
...@@ -83,11 +83,10 @@ int ext4_check_dir_entry(const char *function, struct inode *dir, ...@@ -83,11 +83,10 @@ int ext4_check_dir_entry(const char *function, struct inode *dir,
error_msg = "inode out of bounds"; error_msg = "inode out of bounds";
if (error_msg != NULL) if (error_msg != NULL)
__ext4_error(dir->i_sb, function, ext4_error_inode(function, dir,
"bad entry in directory #%lu: %s - block=%llu" "bad entry in directory: %s - block=%llu"
"offset=%u(%u), inode=%u, rec_len=%d, name_len=%d", "offset=%u(%u), inode=%u, rec_len=%d, name_len=%d",
dir->i_ino, error_msg, error_msg, (unsigned long long) bh->b_blocknr,
(unsigned long long) bh->b_blocknr,
(unsigned) (offset%bh->b_size), offset, (unsigned) (offset%bh->b_size), offset,
le32_to_cpu(de->inode), le32_to_cpu(de->inode),
rlen, de->name_len); rlen, de->name_len);
...@@ -152,9 +151,8 @@ static int ext4_readdir(struct file *filp, ...@@ -152,9 +151,8 @@ static int ext4_readdir(struct file *filp,
*/ */
if (!bh) { if (!bh) {
if (!dir_has_error) { if (!dir_has_error) {
ext4_error(sb, "directory #%lu " EXT4_ERROR_INODE(inode, "directory "
"contains a hole at offset %Lu", "contains a hole at offset %Lu",
inode->i_ino,
(unsigned long long) filp->f_pos); (unsigned long long) filp->f_pos);
dir_has_error = 1; dir_has_error = 1;
} }
......
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
#endif #endif
#define EXT4_ERROR_INODE(inode, fmt, a...) \ #define EXT4_ERROR_INODE(inode, fmt, a...) \
ext4_error_inode(__func__, (inode), (fmt), ## a); ext4_error_inode(__func__, (inode), (fmt), ## a)
#define EXT4_ERROR_FILE(file, fmt, a...) \ #define EXT4_ERROR_FILE(file, fmt, a...) \
ext4_error_file(__func__, (file), (fmt), ## a); ext4_error_file(__func__, (file), (fmt), ## a)
/* data type for block offset of block group */ /* data type for block offset of block group */
typedef int ext4_grpblk_t; typedef int ext4_grpblk_t;
......
...@@ -439,10 +439,10 @@ static int __ext4_ext_check(const char *function, struct inode *inode, ...@@ -439,10 +439,10 @@ static int __ext4_ext_check(const char *function, struct inode *inode,
return 0; return 0;
corrupted: corrupted:
__ext4_error(inode->i_sb, function, ext4_error_inode(function, inode,
"bad header/extent in inode #%lu: %s - magic %x, " "bad header/extent: %s - magic %x, "
"entries %u, max %u(%u), depth %u(%u)", "entries %u, max %u(%u), depth %u(%u)",
inode->i_ino, error_msg, le16_to_cpu(eh->eh_magic), error_msg, le16_to_cpu(eh->eh_magic),
le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max), le16_to_cpu(eh->eh_entries), le16_to_cpu(eh->eh_max),
max, le16_to_cpu(eh->eh_depth), depth); max, le16_to_cpu(eh->eh_depth), depth);
...@@ -1622,9 +1622,7 @@ int ext4_ext_try_to_merge(struct inode *inode, ...@@ -1622,9 +1622,7 @@ int ext4_ext_try_to_merge(struct inode *inode,
merge_done = 1; merge_done = 1;
WARN_ON(eh->eh_entries == 0); WARN_ON(eh->eh_entries == 0);
if (!eh->eh_entries) if (!eh->eh_entries)
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode, "eh->eh_entries = 0!");
"inode#%lu, eh->eh_entries = 0!",
inode->i_ino);
} }
return merge_done; return merge_done;
......
...@@ -348,9 +348,8 @@ static int __ext4_check_blockref(const char *function, struct inode *inode, ...@@ -348,9 +348,8 @@ static int __ext4_check_blockref(const char *function, struct inode *inode,
if (blk && if (blk &&
unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb), unlikely(!ext4_data_block_valid(EXT4_SB(inode->i_sb),
blk, 1))) { blk, 1))) {
__ext4_error(inode->i_sb, function, ext4_error_inode(function, inode,
"invalid block reference %u " "invalid block reference %u", blk);
"in inode #%lu", blk, inode->i_ino);
return -EIO; return -EIO;
} }
} }
...@@ -1129,15 +1128,15 @@ void ext4_da_update_reserve_space(struct inode *inode, ...@@ -1129,15 +1128,15 @@ void ext4_da_update_reserve_space(struct inode *inode,
ext4_discard_preallocations(inode); ext4_discard_preallocations(inode);
} }
static int check_block_validity(struct inode *inode, const char *msg, static int check_block_validity(struct inode *inode, const char *func,
sector_t logical, sector_t phys, int len) struct ext4_map_blocks *map)
{ {
if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), phys, len)) { if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk,
__ext4_error(inode->i_sb, msg, map->m_len)) {
"inode #%lu logical block %llu mapped to %llu " ext4_error_inode(func, inode,
"(size %d)", inode->i_ino, "lblock %lu mapped to illegal pblock %llu "
(unsigned long long) logical, "(length %d)", (unsigned long) map->m_lblk,
(unsigned long long) phys, len); map->m_pblk, map->m_len);
return -EIO; return -EIO;
} }
return 0; return 0;
...@@ -1245,8 +1244,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, ...@@ -1245,8 +1244,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
up_read((&EXT4_I(inode)->i_data_sem)); up_read((&EXT4_I(inode)->i_data_sem));
if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) { if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) {
int ret = check_block_validity(inode, "file system corruption", int ret = check_block_validity(inode, __func__, map);
map->m_lblk, map->m_pblk, retval);
if (ret != 0) if (ret != 0)
return ret; return ret;
} }
...@@ -1326,10 +1324,9 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, ...@@ -1326,10 +1324,9 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
up_write((&EXT4_I(inode)->i_data_sem)); up_write((&EXT4_I(inode)->i_data_sem));
if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) { if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) {
int ret = check_block_validity(inode, "file system " int ret = check_block_validity(inode,
"corruption after allocation", "ext4_map_blocks_after_alloc",
map->m_lblk, map->m_pblk, map);
retval);
if (ret != 0) if (ret != 0)
return ret; return ret;
} }
...@@ -4327,10 +4324,9 @@ static int ext4_clear_blocks(handle_t *handle, struct inode *inode, ...@@ -4327,10 +4324,9 @@ static int ext4_clear_blocks(handle_t *handle, struct inode *inode,
if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), block_to_free, if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), block_to_free,
count)) { count)) {
ext4_error(inode->i_sb, "inode #%lu: " EXT4_ERROR_INODE(inode, "attempt to clear invalid "
"attempt to clear blocks %llu len %lu, invalid", "blocks %llu len %lu",
inode->i_ino, (unsigned long long) block_to_free, (unsigned long long) block_to_free, count);
count);
return 1; return 1;
} }
...@@ -4435,11 +4431,10 @@ static void ext4_free_data(handle_t *handle, struct inode *inode, ...@@ -4435,11 +4431,10 @@ static void ext4_free_data(handle_t *handle, struct inode *inode,
if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh)) if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh))
ext4_handle_dirty_metadata(handle, inode, this_bh); ext4_handle_dirty_metadata(handle, inode, this_bh);
else else
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode,
"circular indirect block detected, " "circular indirect block detected at "
"inode=%lu, block=%llu", "block %llu",
inode->i_ino, (unsigned long long) this_bh->b_blocknr);
(unsigned long long) this_bh->b_blocknr);
} }
} }
...@@ -4477,11 +4472,10 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode, ...@@ -4477,11 +4472,10 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), if (!ext4_data_block_valid(EXT4_SB(inode->i_sb),
nr, 1)) { nr, 1)) {
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode,
"indirect mapped block in inode " "invalid indirect mapped "
"#%lu invalid (level %d, blk #%lu)", "block %lu (level %d)",
inode->i_ino, depth, (unsigned long) nr, depth);
(unsigned long) nr);
break; break;
} }
...@@ -4493,9 +4487,9 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode, ...@@ -4493,9 +4487,9 @@ static void ext4_free_branches(handle_t *handle, struct inode *inode,
* (should be rare). * (should be rare).
*/ */
if (!bh) { if (!bh) {
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode,
"Read failure, inode=%lu, block=%llu", "Read failure block=%llu",
inode->i_ino, nr); (unsigned long long) nr);
continue; continue;
} }
...@@ -4810,8 +4804,8 @@ static int __ext4_get_inode_loc(struct inode *inode, ...@@ -4810,8 +4804,8 @@ static int __ext4_get_inode_loc(struct inode *inode,
bh = sb_getblk(sb, block); bh = sb_getblk(sb, block);
if (!bh) { if (!bh) {
ext4_error(sb, "unable to read inode block - " EXT4_ERROR_INODE(inode, "unable to read inode block - "
"inode=%lu, block=%llu", inode->i_ino, block); "block %llu", block);
return -EIO; return -EIO;
} }
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
...@@ -4909,8 +4903,8 @@ static int __ext4_get_inode_loc(struct inode *inode, ...@@ -4909,8 +4903,8 @@ static int __ext4_get_inode_loc(struct inode *inode,
submit_bh(READ_META, bh); submit_bh(READ_META, bh);
wait_on_buffer(bh); wait_on_buffer(bh);
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
ext4_error(sb, "unable to read inode block - inode=%lu," EXT4_ERROR_INODE(inode, "unable to read inode "
" block=%llu", inode->i_ino, block); "block %llu", block);
brelse(bh); brelse(bh);
return -EIO; return -EIO;
} }
...@@ -5121,8 +5115,8 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) ...@@ -5121,8 +5115,8 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
ret = 0; ret = 0;
if (ei->i_file_acl && if (ei->i_file_acl &&
!ext4_data_block_valid(EXT4_SB(sb), ei->i_file_acl, 1)) { !ext4_data_block_valid(EXT4_SB(sb), ei->i_file_acl, 1)) {
ext4_error(sb, "bad extended attribute block %llu inode #%lu", EXT4_ERROR_INODE(inode, "bad extended attribute block %llu",
ei->i_file_acl, inode->i_ino); ei->i_file_acl);
ret = -EIO; ret = -EIO;
goto bad_inode; goto bad_inode;
} else if (ei->i_flags & EXT4_EXTENTS_FL) { } else if (ei->i_flags & EXT4_EXTENTS_FL) {
...@@ -5167,8 +5161,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino) ...@@ -5167,8 +5161,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
new_decode_dev(le32_to_cpu(raw_inode->i_block[1]))); new_decode_dev(le32_to_cpu(raw_inode->i_block[1])));
} else { } else {
ret = -EIO; ret = -EIO;
ext4_error(inode->i_sb, "bogus i_mode (%o) for inode=%lu", EXT4_ERROR_INODE(inode, "bogus i_mode (%o)", inode->i_mode);
inode->i_mode, inode->i_ino);
goto bad_inode; goto bad_inode;
} }
brelse(iloc.bh); brelse(iloc.bh);
...@@ -5406,9 +5399,9 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -5406,9 +5399,9 @@ int ext4_write_inode(struct inode *inode, struct writeback_control *wbc)
if (wbc->sync_mode == WB_SYNC_ALL) if (wbc->sync_mode == WB_SYNC_ALL)
sync_dirty_buffer(iloc.bh); sync_dirty_buffer(iloc.bh);
if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) { if (buffer_req(iloc.bh) && !buffer_uptodate(iloc.bh)) {
ext4_error(inode->i_sb, "IO error syncing inode, " EXT4_ERROR_INODE(inode,
"inode=%lu, block=%llu", inode->i_ino, "IO error syncing inode (block=%llu)",
(unsigned long long)iloc.bh->b_blocknr); (unsigned long long) iloc.bh->b_blocknr);
err = -EIO; err = -EIO;
} }
brelse(iloc.bh); brelse(iloc.bh);
......
...@@ -530,7 +530,7 @@ mext_leaf_block(handle_t *handle, struct inode *orig_inode, ...@@ -530,7 +530,7 @@ mext_leaf_block(handle_t *handle, struct inode *orig_inode,
* new_ext |-------| * new_ext |-------|
*/ */
if (le32_to_cpu(oext->ee_block) + oext_alen - 1 < new_ext_end) { if (le32_to_cpu(oext->ee_block) + oext_alen - 1 < new_ext_end) {
ext4_error(orig_inode->i_sb, EXT4_ERROR_INODE(orig_inode,
"new_ext_end(%u) should be less than or equal to " "new_ext_end(%u) should be less than or equal to "
"oext->ee_block(%u) + oext_alen(%d) - 1", "oext->ee_block(%u) + oext_alen(%d) - 1",
new_ext_end, le32_to_cpu(oext->ee_block), new_ext_end, le32_to_cpu(oext->ee_block),
...@@ -693,12 +693,12 @@ mext_replace_branches(handle_t *handle, struct inode *orig_inode, ...@@ -693,12 +693,12 @@ mext_replace_branches(handle_t *handle, struct inode *orig_inode,
while (1) { while (1) {
/* The extent for donor must be found. */ /* The extent for donor must be found. */
if (!dext) { if (!dext) {
ext4_error(donor_inode->i_sb, EXT4_ERROR_INODE(donor_inode,
"The extent for donor must be found"); "The extent for donor must be found");
*err = -EIO; *err = -EIO;
goto out; goto out;
} else if (donor_off != le32_to_cpu(tmp_dext.ee_block)) { } else if (donor_off != le32_to_cpu(tmp_dext.ee_block)) {
ext4_error(donor_inode->i_sb, EXT4_ERROR_INODE(donor_inode,
"Donor offset(%u) and the first block of donor " "Donor offset(%u) and the first block of donor "
"extent(%u) should be equal", "extent(%u) should be equal",
donor_off, donor_off,
...@@ -1355,7 +1355,7 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp, ...@@ -1355,7 +1355,7 @@ ext4_move_extents(struct file *o_filp, struct file *d_filp,
if (ret1 < 0) if (ret1 < 0)
break; break;
if (*moved_len > len) { if (*moved_len > len) {
ext4_error(orig_inode->i_sb, EXT4_ERROR_INODE(orig_inode,
"We replaced blocks too much! " "We replaced blocks too much! "
"sum of replaced: %llu requested: %llu", "sum of replaced: %llu requested: %llu",
*moved_len, len); *moved_len, len);
......
...@@ -943,8 +943,8 @@ static struct buffer_head * ext4_find_entry (struct inode *dir, ...@@ -943,8 +943,8 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
wait_on_buffer(bh); wait_on_buffer(bh);
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
/* read error, skip block & hope for the best */ /* read error, skip block & hope for the best */
ext4_error(sb, "reading directory #%lu offset %lu", EXT4_ERROR_INODE(dir, "reading directory lblock %lu",
dir->i_ino, (unsigned long)block); (unsigned long) block);
brelse(bh); brelse(bh);
goto next; goto next;
} }
...@@ -1066,15 +1066,15 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru ...@@ -1066,15 +1066,15 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru
__u32 ino = le32_to_cpu(de->inode); __u32 ino = le32_to_cpu(de->inode);
brelse(bh); brelse(bh);
if (!ext4_valid_inum(dir->i_sb, ino)) { if (!ext4_valid_inum(dir->i_sb, ino)) {
ext4_error(dir->i_sb, "bad inode number: %u", ino); EXT4_ERROR_INODE(dir, "bad inode number: %u", ino);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} }
inode = ext4_iget(dir->i_sb, ino); inode = ext4_iget(dir->i_sb, ino);
if (unlikely(IS_ERR(inode))) { if (unlikely(IS_ERR(inode))) {
if (PTR_ERR(inode) == -ESTALE) { if (PTR_ERR(inode) == -ESTALE) {
ext4_error(dir->i_sb, EXT4_ERROR_INODE(dir,
"deleted inode referenced: %u", "deleted inode referenced: %u",
ino); ino);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} else { } else {
return ERR_CAST(inode); return ERR_CAST(inode);
...@@ -1104,8 +1104,8 @@ struct dentry *ext4_get_parent(struct dentry *child) ...@@ -1104,8 +1104,8 @@ struct dentry *ext4_get_parent(struct dentry *child)
brelse(bh); brelse(bh);
if (!ext4_valid_inum(child->d_inode->i_sb, ino)) { if (!ext4_valid_inum(child->d_inode->i_sb, ino)) {
ext4_error(child->d_inode->i_sb, EXT4_ERROR_INODE(child->d_inode,
"bad inode number: %u", ino); "bad parent inode number: %u", ino);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} }
...@@ -1404,9 +1404,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry, ...@@ -1404,9 +1404,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
de = (struct ext4_dir_entry_2 *)((char *)fde + de = (struct ext4_dir_entry_2 *)((char *)fde +
ext4_rec_len_from_disk(fde->rec_len, blocksize)); ext4_rec_len_from_disk(fde->rec_len, blocksize));
if ((char *) de >= (((char *) root) + blocksize)) { if ((char *) de >= (((char *) root) + blocksize)) {
ext4_error(dir->i_sb, EXT4_ERROR_INODE(dir, "invalid rec_len for '..'");
"invalid rec_len for '..' in inode %lu",
dir->i_ino);
brelse(bh); brelse(bh);
return -EIO; return -EIO;
} }
...@@ -1915,9 +1913,8 @@ static int empty_dir(struct inode *inode) ...@@ -1915,9 +1913,8 @@ static int empty_dir(struct inode *inode)
if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) || if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) ||
!(bh = ext4_bread(NULL, inode, 0, 0, &err))) { !(bh = ext4_bread(NULL, inode, 0, 0, &err))) {
if (err) if (err)
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode,
"error %d reading directory #%lu offset 0", "error %d reading directory lblock 0", err);
err, inode->i_ino);
else else
ext4_warning(inode->i_sb, ext4_warning(inode->i_sb,
"bad directory (dir #%lu) - no data block", "bad directory (dir #%lu) - no data block",
...@@ -1941,17 +1938,17 @@ static int empty_dir(struct inode *inode) ...@@ -1941,17 +1938,17 @@ static int empty_dir(struct inode *inode)
de = ext4_next_entry(de1, sb->s_blocksize); de = ext4_next_entry(de1, sb->s_blocksize);
while (offset < inode->i_size) { while (offset < inode->i_size) {
if (!bh || if (!bh ||
(void *) de >= (void *) (bh->b_data+sb->s_blocksize)) { (void *) de >= (void *) (bh->b_data+sb->s_blocksize)) {
unsigned int lblock;
err = 0; err = 0;
brelse(bh); brelse(bh);
bh = ext4_bread(NULL, inode, lblock = offset >> EXT4_BLOCK_SIZE_BITS(sb);
offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err); bh = ext4_bread(NULL, inode, lblock, 0, &err);
if (!bh) { if (!bh) {
if (err) if (err)
ext4_error(sb, EXT4_ERROR_INODE(inode,
"error %d reading directory" "error %d reading directory "
" #%lu offset %u", "lblock %u", err, lblock);
err, inode->i_ino, offset);
offset += sb->s_blocksize; offset += sb->s_blocksize;
continue; continue;
} }
......
...@@ -228,9 +228,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name, ...@@ -228,9 +228,8 @@ ext4_xattr_block_get(struct inode *inode, int name_index, const char *name,
atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
if (ext4_xattr_check_block(bh)) { if (ext4_xattr_check_block(bh)) {
bad_block: bad_block:
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode, "bad block %llu",
"inode %lu: bad block %llu", inode->i_ino, EXT4_I(inode)->i_file_acl);
EXT4_I(inode)->i_file_acl);
error = -EIO; error = -EIO;
goto cleanup; goto cleanup;
} }
...@@ -372,9 +371,8 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size) ...@@ -372,9 +371,8 @@ ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size)
ea_bdebug(bh, "b_count=%d, refcount=%d", ea_bdebug(bh, "b_count=%d, refcount=%d",
atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount)); atomic_read(&(bh->b_count)), le32_to_cpu(BHDR(bh)->h_refcount));
if (ext4_xattr_check_block(bh)) { if (ext4_xattr_check_block(bh)) {
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode, "bad block %llu",
"inode %lu: bad block %llu", inode->i_ino, EXT4_I(inode)->i_file_acl);
EXT4_I(inode)->i_file_acl);
error = -EIO; error = -EIO;
goto cleanup; goto cleanup;
} }
...@@ -666,8 +664,8 @@ ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i, ...@@ -666,8 +664,8 @@ ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i,
atomic_read(&(bs->bh->b_count)), atomic_read(&(bs->bh->b_count)),
le32_to_cpu(BHDR(bs->bh)->h_refcount)); le32_to_cpu(BHDR(bs->bh)->h_refcount));
if (ext4_xattr_check_block(bs->bh)) { if (ext4_xattr_check_block(bs->bh)) {
ext4_error(sb, "inode %lu: bad block %llu", EXT4_ERROR_INODE(inode, "bad block %llu",
inode->i_ino, EXT4_I(inode)->i_file_acl); EXT4_I(inode)->i_file_acl);
error = -EIO; error = -EIO;
goto cleanup; goto cleanup;
} }
...@@ -880,8 +878,8 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, ...@@ -880,8 +878,8 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
goto cleanup; goto cleanup;
bad_block: bad_block:
ext4_error(inode->i_sb, "inode %lu: bad block %llu", EXT4_ERROR_INODE(inode, "bad block %llu",
inode->i_ino, EXT4_I(inode)->i_file_acl); EXT4_I(inode)->i_file_acl);
goto cleanup; goto cleanup;
#undef header #undef header
...@@ -1194,8 +1192,8 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, ...@@ -1194,8 +1192,8 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
if (!bh) if (!bh)
goto cleanup; goto cleanup;
if (ext4_xattr_check_block(bh)) { if (ext4_xattr_check_block(bh)) {
ext4_error(inode->i_sb, "inode %lu: bad block %llu", EXT4_ERROR_INODE(inode, "bad block %llu",
inode->i_ino, EXT4_I(inode)->i_file_acl); EXT4_I(inode)->i_file_acl);
error = -EIO; error = -EIO;
goto cleanup; goto cleanup;
} }
...@@ -1372,14 +1370,14 @@ ext4_xattr_delete_inode(handle_t *handle, struct inode *inode) ...@@ -1372,14 +1370,14 @@ ext4_xattr_delete_inode(handle_t *handle, struct inode *inode)
goto cleanup; goto cleanup;
bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl); bh = sb_bread(inode->i_sb, EXT4_I(inode)->i_file_acl);
if (!bh) { if (!bh) {
ext4_error(inode->i_sb, "inode %lu: block %llu read error", EXT4_ERROR_INODE(inode, "block %llu read error",
inode->i_ino, EXT4_I(inode)->i_file_acl); EXT4_I(inode)->i_file_acl);
goto cleanup; goto cleanup;
} }
if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) ||
BHDR(bh)->h_blocks != cpu_to_le32(1)) { BHDR(bh)->h_blocks != cpu_to_le32(1)) {
ext4_error(inode->i_sb, "inode %lu: bad block %llu", EXT4_ERROR_INODE(inode, "bad block %llu",
inode->i_ino, EXT4_I(inode)->i_file_acl); EXT4_I(inode)->i_file_acl);
goto cleanup; goto cleanup;
} }
ext4_xattr_release_block(handle, inode, bh); ext4_xattr_release_block(handle, inode, bh);
...@@ -1504,9 +1502,8 @@ ext4_xattr_cache_find(struct inode *inode, struct ext4_xattr_header *header, ...@@ -1504,9 +1502,8 @@ ext4_xattr_cache_find(struct inode *inode, struct ext4_xattr_header *header,
} }
bh = sb_bread(inode->i_sb, ce->e_block); bh = sb_bread(inode->i_sb, ce->e_block);
if (!bh) { if (!bh) {
ext4_error(inode->i_sb, EXT4_ERROR_INODE(inode, "block %lu read error",
"inode %lu: block %lu read error", (unsigned long) ce->e_block);
inode->i_ino, (unsigned long) ce->e_block);
} else if (le32_to_cpu(BHDR(bh)->h_refcount) >= } else if (le32_to_cpu(BHDR(bh)->h_refcount) >=
EXT4_XATTR_REFCOUNT_MAX) { EXT4_XATTR_REFCOUNT_MAX) {
ea_idebug(inode, "block %lu refcount %d>=%d", ea_idebug(inode, "block %lu refcount %d>=%d",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment