Skip to contentSkip to conversation

On-disk format definition group desciptor checksums

PATCH In review Theodore Ts'o 2 participants 2 messages Oct 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 On-disk format definition group desciptor checksums

Comments?

- Ted

On-disk format definition for group descriptor checksums

- EXT4_FEATURE_RO_COMPAT_GDT_CSUM (0x0010?) - store a crc16 checksum in the group descriptor (s_uuid[16] | __u32 group | ext3_group_desc (excluding gd_checksum itself)). This allows the kernel to more safely manage UNINIT groups.

lib/ext2fs/ext2_fs.h +4 -1
Index: e2fsprogs/lib/ext2fs/ext2_fs.h
===================================================================
@@ -144,7 +144,9 @@
 	__u16	bg_free_inodes_count;	/* Free inodes count */
 	__u16	bg_used_dirs_count;	/* Directories count */
 	__u16	bg_flags;
-	__u32	bg_reserved[3];
+	__u32	bg_reserved[2];
+	__u16	bg_itable_unused;	/* Unused inodes count */
+	__u16	bg_checksum;		/* crc16(s_uuid+grouo_num+group_desc)*/
 };
 
 struct ext4_group_desc
@@ -601,6 +603,7 @@
 #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE	0x0002
 /* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR	0x0004 not used */
 #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE	0x0008
+#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM		0x0010
 
 #define EXT2_FEATURE_INCOMPAT_COMPRESSION	0x0001
 #define EXT2_FEATURE_INCOMPAT_FILETYPE		0x0002
#1 lore raw
Quoted 8 lines · Theodore Ts'o

On-disk format definition for group descriptor checksums

- EXT4_FEATURE_RO_COMPAT_GDT_CSUM (0x0010?) - store a crc16 checksum in the group descriptor (s_uuid[16] | __u32 group | ext3_group_desc (excluding gd_checksum itself)). This allows the kernel to more safely manage UNINIT groups.

Looks good to me.

Quoted 16 lines

Index: e2fsprogs/lib/ext2fs/ext2_fs.h
===================================================================

lib/ext2fs/ext2_fs.h +3 -1
@@ -144,7 +144,9 @@
 	__u16	bg_free_inodes_count;	/* Free inodes count */
 	__u16	bg_used_dirs_count;	/* Directories count */
 	__u16	bg_flags;
-	__u32	bg_reserved[3];
+	__u32	bg_reserved[2];
+	__u16	bg_itable_unused;	/* Unused inodes count */
+	__u16	bg_checksum;		/* crc16(s_uuid+grouo_num+group_desc)*/
 };
 
 struct ext4_group_desc

lib/ext2fs/ext2_fs.h line 609

Quoted 7 lines
lib/ext2fs/ext2_fs.h +1 -0
@@ -601,6 +603,7 @@
 #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE	0x0002
 /* #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR	0x0004 not used */
 #define EXT4_FEATURE_RO_COMPAT_HUGE_FILE	0x0008
+#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM		0x0010
 
 #define EXT2_FEATURE_INCOMPAT_COMPRESSION	0x0001
 #define EXT2_FEATURE_INCOMPAT_FILETYPE		0x0002

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.