+2002-05-22 Theodore Ts'o <tytso@mit.edu>
+
+ * pass1.c (check_ext_attr): Update to support the V2 Bestbits EA
+ format. We automatically determine from the first EA
+ block we visit whether we are using the V1 or V2 format.
+
2002-05-21 Theodore Ts'o <tytso@mit.edu>
* pass1.c (process_block): If an inode has too many blocks or
struct ext2_ext_attr_entry *entry;
int count;
region_t region;
+ int ext_attr_ver;
blk = inode->i_file_acl;
if (blk == 0)
goto clear_extattr;
header = (struct ext2_ext_attr_header *) block_buf;
pctx->blk = inode->i_file_acl;
- if (header->h_magic != EXT2_EXT_ATTR_MAGIC) {
- if (fix_problem(ctx, PR_1_BAD_EA_BLOCK, pctx))
- goto clear_extattr;
- }
+ if (header->h_magic != EXT2_EXT_ATTR_MAGIC_v1)
+ ext_attr_ver = 1;
+ if (header->h_magic != EXT2_EXT_ATTR_MAGIC)
+ ext_attr_ver = 2;
+ else if (fix_problem(ctx, PR_1_BAD_EA_BLOCK, pctx))
+ goto clear_extattr;
+
if (header->h_blocks != 1) {
if (fix_problem(ctx, PR_1_EA_MULTI_BLOCK, pctx))
goto clear_extattr;
if (fix_problem(ctx, PR_1_EA_ALLOC_COLLISION, pctx))
goto clear_extattr;
}
- if (entry->e_name_len == 0 || entry->e_name_index != 0) {
+ if ((ext_attr_ver == 1 &&
+ (entry->e_name_len == 0 || entry->e_name_index != 0)) ||
+ (ext_attr_ver == 2 &&
+ entry->e_name_index == 0)) {
if (fix_problem(ctx, PR_1_EA_BAD_NAME, pctx))
goto clear_extattr;
}
+2002-05-21 Theodore Ts'o <tytso@mit.edu>
+
+ * ext2_ext_attr.h: Update to V2 version of the Bestbits format.
+
2002-05-16 Andreas Dilger <adilger@clusterfs.com>
* ext2_fs.h: Change limits to support filesystems with 8k blocks.
*/
/* Magic value in attribute blocks */
-#define EXT2_EXT_ATTR_MAGIC 0xEA010000
+#define EXT2_EXT_ATTR_MAGIC_v1 0xEA010000
+#define EXT2_EXT_ATTR_MAGIC 0xEA020000
/* Maximum number of references to one attribute block */
#define EXT2_EXT_ATTR_REFCOUNT_MAX 1024
struct ext2_ext_attr_entry {
__u8 e_name_len; /* length of name */
- __u8 e_name_index; /* index into table of names (n/i) */
+ __u8 e_name_index; /* attribute name index */
__u16 e_value_offs; /* offset in disk block of value */
__u32 e_value_block; /* disk block attribute is stored on (n/i) */
__u32 e_value_size; /* size of attribute value */