Browse Source

FIX: ext4_extent_full.c and ext4_extent.c lack endian conversion when doing checksum.

pull/11/head
ngkaho1234 9 years ago
parent
commit
7bec846d34
  1. 2
      lwext4/ext4_extent.c
  2. 4
      lwext4/ext4_extent_full.c

2
lwext4/ext4_extent.c

@ -163,7 +163,7 @@ static void ext4_extent_block_csum_set(struct ext4_inode_ref *inode_ref,
struct ext4_extent_tail *tail;
tail = find_ext4_extent_tail(eh);
tail->et_checksum = ext4_ext_block_csum(inode_ref, eh);
tail->et_checksum = to_le32(ext4_ext_block_csum(inode_ref, eh));
}
/**@brief Get physical block in the extent tree by logical block number.

4
lwext4/ext4_extent_full.c

@ -342,7 +342,7 @@ static void ext4_extent_block_csum_set(struct ext4_inode_ref *inode_ref,
struct ext4_extent_tail *tail;
tail = find_ext4_extent_tail(eh);
tail->et_checksum = ext4_ext_block_csum(inode_ref, eh);
tail->et_checksum = to_le32(ext4_ext_block_csum(inode_ref, eh));
}
static int ext4_ext_dirty(struct ext4_inode_ref *inode_ref,
@ -409,7 +409,7 @@ static int ext4_ext_check(struct ext4_inode_ref *inode_ref,
}
tail = find_ext4_extent_tail(eh);
if (tail->et_checksum != ext4_ext_block_csum(inode_ref, eh)) {
if (tail->et_checksum != to_le32(ext4_ext_block_csum(inode_ref, eh))) {
/* FIXME: Warning: extent checksum damaged? */
}

Loading…
Cancel
Save