Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163672
b: refs/heads/master
c: 80e4246
h: refs/heads/master
v: v3
  • Loading branch information
Theodore Ts'o committed Sep 8, 2009
1 parent f019b03 commit 272993b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a827eaffff07c7d58a4cb32158cbeb4849f4e33a
refs/heads/master: 80e42468d65475e92651e62175bb7807773321d0
16 changes: 8 additions & 8 deletions trunk/fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,16 +1121,15 @@ static void ext4_da_update_reserve_space(struct inode *inode, int used)
ext4_discard_preallocations(inode);
}

static int check_block_validity(struct inode *inode, sector_t logical,
sector_t phys, int len)
static int check_block_validity(struct inode *inode, const char *msg,
sector_t logical, sector_t phys, int len)
{
if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), phys, len)) {
ext4_error(inode->i_sb, "check_block_validity",
ext4_error(inode->i_sb, msg,
"inode #%lu logical block %llu mapped to %llu "
"(size %d)", inode->i_ino,
(unsigned long long) logical,
(unsigned long long) phys, len);
WARN_ON(1);
return -EIO;
}
return 0;
Expand Down Expand Up @@ -1182,8 +1181,8 @@ int ext4_get_blocks(handle_t *handle, struct inode *inode, sector_t block,
up_read((&EXT4_I(inode)->i_data_sem));

if (retval > 0 && buffer_mapped(bh)) {
int ret = check_block_validity(inode, block,
bh->b_blocknr, retval);
int ret = check_block_validity(inode, "file system corruption",
block, bh->b_blocknr, retval);
if (ret != 0)
return ret;
}
Expand Down Expand Up @@ -1264,8 +1263,9 @@ int ext4_get_blocks(handle_t *handle, struct inode *inode, sector_t block,

up_write((&EXT4_I(inode)->i_data_sem));
if (retval > 0 && buffer_mapped(bh)) {
int ret = check_block_validity(inode, block,
bh->b_blocknr, retval);
int ret = check_block_validity(inode, "file system "
"corruption after allocation",
block, bh->b_blocknr, retval);
if (ret != 0)
return ret;
}
Expand Down

0 comments on commit 272993b

Please sign in to comment.