Thread (30 messages) 30 messages, 5 authors, 2011-09-05
STALE5391d
Revisions (5)
  1. v1 current
  2. v2 [diff vs current]
  3. v2 [diff vs current]
  4. v2 [diff vs current]
  5. v3 [diff vs current]

[PATCH 14/16] ext4: Make inode checksum cover empty space

From: Darrick J. Wong <hidden>
Date: 2011-09-01 00:32:07
Also in: linux-fsdevel, lkml
Subsystem: ext4 file system, filesystems (vfs and infrastructure), the rest · Maintainers: "Theodore Ts'o", Alexander Viro, Christian Brauner, Linus Torvalds

Extend the inode checksum to cover the empty space between the end of the
inode's data fields and the end of the space allocated for the inode.  This
enables us to cover extended attribute data that might live in the empty space.

Signed-off-by: Darrick J. Wong <redacted>
---
 fs/ext4/inode.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 44a7f88..e24ba98 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -53,7 +53,6 @@
 static __le32 ext4_inode_csum(struct inode *inode, struct ext4_inode *raw)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
-	struct ext4_inode_info *ei = EXT4_I(inode);
 	int offset = offsetof(struct ext4_inode, i_checksum);
 	__le32 inum = cpu_to_le32(inode->i_ino);
 	__u32 crc = 0;
@@ -70,8 +69,7 @@ static __le32 ext4_inode_csum(struct inode *inode, struct ext4_inode *raw)
 	crc = crc32c_le(crc, (__u8 *)raw, offset);
 	offset += sizeof(raw->i_checksum); /* skip checksum */
 	crc = crc32c_le(crc, (__u8 *)raw + offset,
-		    EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize -
-		    offset);
+		    EXT4_INODE_SIZE(inode->i_sb) - offset);
 	return cpu_to_le32(crc);
 }
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help