Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344862
b: refs/heads/master
c: dffe9d8
h: refs/heads/master
v: v3
  • Loading branch information
Theodore Ts'o committed Nov 11, 2012
1 parent 035c24d commit 5f9da4b
Show file tree
Hide file tree
Showing 2 changed files with 11 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: c8c0df241cc2719b1262e627f999638411934f60
refs/heads/master: dffe9d8da715bed4d395883add90a2d150d85729
18 changes: 10 additions & 8 deletions trunk/fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ static __le32 ext4_dirent_csum(struct inode *inode,
return cpu_to_le32(csum);
}

static void warn_no_space_for_csum(struct inode *inode)
{
ext4_warning(inode->i_sb, "no space in directory inode %lu leaf for "
"checksum. Please run e2fsck -D.", inode->i_ino);
}

int ext4_dirent_csum_verify(struct inode *inode, struct ext4_dir_entry *dirent)
{
struct ext4_dir_entry_tail *t;
Expand All @@ -271,8 +277,7 @@ int ext4_dirent_csum_verify(struct inode *inode, struct ext4_dir_entry *dirent)

t = get_dirent_tail(inode, dirent);
if (!t) {
EXT4_ERROR_INODE(inode, "metadata_csum set but no space in dir "
"leaf for checksum. Please run e2fsck -D.");
warn_no_space_for_csum(inode);
return 0;
}

Expand All @@ -294,8 +299,7 @@ static void ext4_dirent_csum_set(struct inode *inode,

t = get_dirent_tail(inode, dirent);
if (!t) {
EXT4_ERROR_INODE(inode, "metadata_csum set but no space in dir "
"leaf for checksum. Please run e2fsck -D.");
warn_no_space_for_csum(inode);
return;
}

Expand Down Expand Up @@ -377,8 +381,7 @@ static int ext4_dx_csum_verify(struct inode *inode,
count = le16_to_cpu(c->count);
if (count_offset + (limit * sizeof(struct dx_entry)) >
EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) {
EXT4_ERROR_INODE(inode, "metadata_csum set but no space for "
"tree checksum found. Run e2fsck -D.");
warn_no_space_for_csum(inode);
return 1;
}
t = (struct dx_tail *)(((struct dx_entry *)c) + limit);
Expand Down Expand Up @@ -408,8 +411,7 @@ static void ext4_dx_csum_set(struct inode *inode, struct ext4_dir_entry *dirent)
count = le16_to_cpu(c->count);
if (count_offset + (limit * sizeof(struct dx_entry)) >
EXT4_BLOCK_SIZE(inode->i_sb) - sizeof(struct dx_tail)) {
EXT4_ERROR_INODE(inode, "metadata_csum set but no space for "
"tree checksum. Run e2fsck -D.");
warn_no_space_for_csum(inode);
return;
}
t = (struct dx_tail *)(((struct dx_entry *)c) + limit);
Expand Down

0 comments on commit 5f9da4b

Please sign in to comment.